I am developing a cross platform Java application with native executables. For Mac OS X I use Jarbundler as an ANT task to create the App package.
Now that Oracle released Java 7 and its own ANT task "Appbundler" I got a problem.
Using the native Mac OS X JavaApplicationStub with Jarbundler only works for Apple Java 6, and using the Oracle JavaApplicationStub with Appbundler only works for Java 7.
I do understand the background of this very well, but I was wondering whether there is a JavaApplicationStub available that works with both Java 6 and Java 7. I haven't found one so far...
And btw: does the JavaApplicationStub has to be a native C/C++/C# binary? Or could it also be an executable shellscript?
Update:
A shell script is a possible alternative to a native JavaApplicationStub.
I extended Ian Roberts basic shell script and released it on GitHub as "universalJavaApplicationStub". It now supports both Apple Java 6 and Oracle Java 7 and also both Info.plist
styles for Java properties in the application bundle (Oracle introduced new property keys). Feel free to use it!
The main executable inside a bundle can be a shell script, so you could use a script that first tries /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
(the java 7 JRE install location), and falls back on /usr/bin/java
if that is not found. The latter will run the most recent JDK that has been installed (6 or 7) and should prompt to install Java 6 if there is no JDK found at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With