简体   繁体   中英

Port Java6 along with application

I have a Java desktop application for Mac, and we are porting Java along with the application. The issue, is that the Java we are using is strictly Java6 and not Java7 (Because Java7 does not have -d32 mode).

So I downloaded Java6 jdk from the apple developer site and have bundled it in the package. And it all works well. But when I try running on other Mac's, then it throws the following error:

/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin
$ ./java -version
dyld: Library not loaded: @rpath/libjli.jnilib
Referenced from: /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/./java
Reason: image not found
Trace/BPT trap: 5

As per this , it tries searching for the respective directory at /Library/Java/JavaVirtualMachines/ and not in the folder I ported along. How can I solve this issue?

How should I port Java6 along with the application.

Secondly, the Java6 I have used is jdk as I could not find the Jre of Java6. It will be appreciated if someone can provide or share Jre6.

Does Apple licensing even allow their JRE to be redistributed with a third-party app?

I think you are making things harder than they need to be. If a user does not have Java 6 installed (possible in OS X 10.7 and 10.8), the Mac OS will automatically prompt the user to download and install it the first time a Java application tries to run. It will then automatically continue launching your app once it's installed.

Just make sure you are bundling your app appropriately for Java 6 (eg, using the old Mac Jar Bundler app or manually creating an equivalent Info.plist) and not Java 7 (eg, using the new Oracle appbundler.jar).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM