Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I have created a .pkg installer for mac using pkgbuild and product build. Is there a way to bundle java jdk 8 along with the package. Say newer version of java is already installed on Mac and my application is compatible with jdk 8 only.
Is there a way that bundled jdk can be put locally for that application ONLY without affecting the newer version of jdk already installed?
You can unzip OpenJDK 8 into a non-system folder (or folder of your application) and use it without affecting other already installed JDKs. There is no need for an installation or modification of global environment variables. Therefore, technically it is not a problem.
Note: Oracle's (not open) JDK has different rules regarding installation and distribution.
If starting your application produces an error:
Error: could not find libjava.dylib Failed to GetJREPath()
This means it uses a JDK native library directly. (See
bugs.openjdk.java.net/browse/JDK-8213362
for more information.) In order to solve this either:
provide the JRE path like
-vm /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home
as described in
eclipse.org/forums/index.php/t/1102885
set
$JAVA_HOME
in a script for your app.
–
–
–
–
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.