Mac Java Application Resource Path

Using the appbundler ant task from oracle ( http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html ) I can create a working Mac application with JRE7 enabled, but loading some resources like native libraries failed because the path at the seams of Info.plist is invalid.

In the build.xml ant task that I use, for example (my own libraries are copied to the Content / Java folder inside the application package):

a) <option value="-Djava.library.path=Contents/Java/" /> b) <option value="-Djava.library.path=$JAVAROOT/" /> c) <option value="-Djava.library.path=$APP_PACKAGE/Contents/Java/" /> 

All results in UnsatisfiedLinkError. No other resources were found, such as splash-image:

 <option value="-splash:Contents/Java/my-splash.png" /> 

Any idea how to set the path for JVMOptions correctly here?

Edit: The Java7 appbundler application does not use the same plist syntax as Apple's Jar Bundler, which comes with jdk6, for example. there is no โ€œJavaโ€ to add SplashFile.

+4
source share
1 answer

According to the appbundler task documentation, the magic variable you are looking for is $APP_ROOT :

 <option value="-Djava.library.path=$APP_ROOT/Contents/Java/" /> 

This also works for <argument value="..."/> (arguments for your main class, as opposed to JVM parameters).

+7
source

All Articles