ddario
ddario

Reputation: 1035

App with bundled JRE doesn't work without Java installed

I'm following the official guide Java app packaging at http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html but the generated app bundle won't work if Java not installed on the system, even though JRE appeares to be bundled correctly (Contents/Plugins/jdk1.7.0_45.jdk).

As soon as I move the java install:

mv /System/Library/Frameworks/JavaVM.framework /tmp/

The app won't launch at all, the Icon doesn't even appear in the dock.

When I try to kick of JavaAppLauncher manually I get this error:

./JavaAppLauncher
Error occurred during initialization of VM
java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:514)
    at java.lang.System.initProperties(Native Method)
at java.lang.System.initializeSystemClass(System.java:1119)

Everything gets back to normal when I return Java to it's proper location. I'm wondering if the guide is maybe outdated, contains an error, or perhaps something I just missed.

Any help is appreaciated.

Upvotes: 1

Views: 681

Answers (1)

Jeanne Boyarsky
Jeanne Boyarsky

Reputation: 12266

Add the new location of Java to the path. The default location is in the path already but since you moved it, you lose that automatic part.

Upvotes: 1

Related Questions