2

I'm trying to to package my java app into an OS X App Bundle and I want to include the JRE, so it can run without a installed JRE.

I'm following http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

The AppBundler Ant Task will generate a .app with the JRE included but it is missing all the binaries.

The App will run but i'm not sure it's not using my installed JRE instead as it's missing the binaries. Or does the included JavaAppLauncher replaces the normal java binary?

user3005567
  • 87
  • 1
  • 11

1 Answers1

1

The bin/ folder is not included when bundling the JRE in an app. The only native binaries it uses are in MyApp/Contents/MacOS and MyApp/Contents/Plugins/MyJRE/Contents/MacOS.

Or does the included JavaAppLauncher replaces the normal java binary?

The app bundle does not call a 'java' command. Some combination of JavaAppLauncher and libjli.dylib invokes Java dynamically.

If you are unsure if it is using the bundled version of Java, output this when your app runs. It will tell you from what location Java is being called:

System.getProperty("java.home", "")
martinez314
  • 12,162
  • 5
  • 36
  • 63
  • What if my app needs to invoke another java program from itself? Without the bundle, usually the steps were to get the JAVA_HOME and append /bin/java, then add the cmd line arguments like "-jar MyApp.jar" and invocation would be successful. But when using the bundled version with missing bin directory, I don't know how to launch another java application. Can you help? – Petros P Mar 01 '16 at 23:52
  • @PetrosP You can copy the bin directory to your application bundle. This is what I have done. appbundler won't copy it by default, so you'll have to copy it yourself. – martinez314 Mar 02 '16 at 12:15