diff --git a/build.xml b/build.xml index 1afb0526..2006b14f 100644 --- a/build.xml +++ b/build.xml @@ -93,75 +93,33 @@ - - - - - + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - + - + @@ -424,7 +382,7 @@ - + diff --git a/src/osx-java7/Info.plist b/src/osx-java7/Info.plist deleted file mode 100644 index 69090c84..00000000 --- a/src/osx-java7/Info.plist +++ /dev/null @@ -1,73 +0,0 @@ - - - - LSUIElement0 - NSHighResolutionCapable - - CFBundleName - DavMail - CFBundleShortVersionString - ${release} - CFBundleGetInfoString - DavMail Gateway ${release-name} - CFBundleAllowMixedLocalizations - false - CFBundleInfoDictionaryVersion - 6.0 - CFBundleExecutable - davmail - CFBundleDevelopmentRegion - English - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - ${release} - CFBundleIconFile - tray.icns - Java - - MainClass - davmail.DavGateway - JVMVersion - 1.5+ - ClassPath - - $JAVAROOT/davmail.jar - $JAVAROOT/activation-1.1.1.jar - $JAVAROOT/appbundler-1.0.jar - $JAVAROOT/checkstyle-all-5.0.jar - $JAVAROOT/commons-codec-1.3.jar - $JAVAROOT/commons-collections-3.1.jar - $JAVAROOT/commons-httpclient-3.1.jar - $JAVAROOT/commons-logging-1.0.4.jar - $JAVAROOT/htmlcleaner-2.2.jar - $JAVAROOT/jackrabbit-webdav-2.4.3.jar - $JAVAROOT/jcharset-1.3.jar - $JAVAROOT/jcifs-1.3.14.jar - $JAVAROOT/jdom-1.0.jar - $JAVAROOT/libgrowl-0.2.jar - $JAVAROOT/libgrowl.jnilib - $JAVAROOT/log4j-1.2.16.jar - $JAVAROOT/mail-1.4.3.jar - $JAVAROOT/slf4j-api-1.3.1.jar - $JAVAROOT/slf4j-log4j12-1.3.1.jar - $JAVAROOT/stax-api-1.0.1.jar - $JAVAROOT/stax2-api-3.1.1.jar - $JAVAROOT/woodstox-core-asl-4.1.2.jar - $JAVAROOT/xercesImpl-2.8.1.jar - - VMOptions - -Dsun.net.inetaddr.ttl=60 -Xmx512m - WorkingDirectory - $APP_PACKAGE - - JVMMainClassName - davmail.DavGateway - JVMOptions - - -Dsun.net.inetaddr.ttl=60 -Xmx512m -Duser.dir=$APP_ROOT - - - diff --git a/src/osx-java7/JavaAppLauncher b/src/osx-java7/JavaAppLauncher deleted file mode 100644 index 7bddebea..00000000 Binary files a/src/osx-java7/JavaAppLauncher and /dev/null differ diff --git a/src/osx-java7/en.lproj/Localizable.strings b/src/osx-java7/en.lproj/Localizable.strings deleted file mode 100644 index cfd612eb..00000000 --- a/src/osx-java7/en.lproj/Localizable.strings +++ /dev/null @@ -1,3 +0,0 @@ -"JRELoadError" = "Java 7 not available, please download and install from http://www.java.com"; -"MainClassNameRequired" = "Main class name is required."; -"JavaDirectoryNotFound" = "Unable to enumerate Java directory contents."; diff --git a/src/osx/Info.plist b/src/osx/Info.plist new file mode 100644 index 00000000..f9fe33cc --- /dev/null +++ b/src/osx/Info.plist @@ -0,0 +1,36 @@ + + + + LSUIElement0 + NSHighResolutionCapable + + CFBundleName + DavMail + CFBundleShortVersionString + ${release} + CFBundleGetInfoString + DavMail Gateway ${release-name} + CFBundleAllowMixedLocalizations + false + CFBundleInfoDictionaryVersion + 6.0 + CFBundleExecutable + davmail + CFBundleDevelopmentRegion + English + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + ${release} + CFBundleIconFile + tray.icns + JVMMainClassName + davmail.DavGateway + JVMOptions + + -Dsun.net.inetaddr.ttl=60 -Xmx512m + + + diff --git a/src/osx/davmail b/src/osx/davmail index 7a390494..8fa69526 100644 --- a/src/osx/davmail +++ b/src/osx/davmail @@ -183,7 +183,7 @@ else # set Working Directory and Java and Resources folder JavaFolder="${OracleJavaFolder}" ResourcesFolder="${OracleResourcesFolder}" - WorkingDirectory="${OracleJavaFolder}" + WorkingDirectory="${AppPackageFolder}" APP_ROOT="${AppPackageFolder}" @@ -222,67 +222,41 @@ elif [ -x /usr/libexec/java_home ] && [ -d "`/usr/libexec/java_home 2> /dev/null JAVACMD="`/usr/libexec/java_home 2> /dev/null`/bin/java" # otherwise check Java standard symlink (old Apple Java) -elif [ -h /Library/Java/Home ]; then +elif [ -x /Library/Java/Home/bin/java ]; then JAVACMD="/Library/Java/Home/bin/java" # fallback: public JRE plugin (Oracle Java) -else +elif [ -x "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" ]; then JAVACMD="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -fi - +else # fallback fallback: /usr/bin/java -# but this would prompt to install deprecated Apple Java 6 - - - + JAVACMD="/usr/bin/java" +fi # -# execute JAVA commandline and do some pre-checks +# execute JAVA commandline #################################################### -# display error message if MainClassName is empty -if [ -z ${JVMMainClass} ]; then - # display error message with applescript - osascript -e "tell application \"System Events\" to display dialog \"ERROR launching '${CFBundleName}'!\n\n'MainClass' isn't specified!\nJava application cannot be started!\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1 with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" - # exit with error - exit 1 +# enable drag&drop to the dock icon +export CFProcessPath="$0" -# check whether $JAVACMD is a file and executable -elif [ -f "$JAVACMD" ] && [ -x "$JAVACMD" ] ; then +# change to Working Directory based upon Apple/Oracle Plist info +cd "${WorkingDirectory}" - # enable drag&drop to the dock icon - export CFProcessPath="$0" - - # change to Working Directory based upon Apple/Oracle Plist info - cd "${WorkingDirectory}" - - # execute Java and set - # - classpath - # - dock icon - # - application name - # - JVM options - # - JVM default options - # - main class - # - JVM arguments - exec "$JAVACMD" \ - -cp "${JVMClassPath}" \ - -Xdock:icon="${ResourcesFolder}/${CFBundleIconFile}" \ - -Xdock:name="${CFBundleName}" \ - ${JVMOptions:+$JVMOptions }\ - ${JVMDefaultOptions:+$JVMDefaultOptions }\ - ${JVMMainClass}\ - ${JVMArguments:+ $JVMArguments} - - -else - - # display error message with applescript - osascript -e "tell application \"System Events\" to display dialog \"ERROR launching '${CFBundleName}'!\n\nYou need to have JAVA installed on your Mac!\nVisit http://java.com for more information...\" with title \"${CFBundleName}\" buttons {\" OK \"} default button 1 with icon path to resource \"${CFBundleIconFile}\" in bundle (path to me)" - - # and open java.com - open http://java.com - - # exit with error - exit 1 -fi +# execute Java and set +# - classpath +# - dock icon +# - application name +# - JVM options +# - JVM default options +# - main class +# - JVM arguments +exec "$JAVACMD" \ + -cp "${JVMClassPath}" \ + -Xdock:icon="${ResourcesFolder}/${CFBundleIconFile}" \ + -Xdock:name="${CFBundleName}" \ + ${JVMOptions:+$JVMOptions }\ + ${JVMDefaultOptions:+$JVMDefaultOptions }\ + ${JVMMainClass}\ + ${JVMArguments:+ $JVMArguments}