I have been using Java Application Bundler to pack a Java application as .app. I have managed to run the application if I pack the JRE7 inside of the .app bundle. Is it poss
usr/libexec/java_home -V
Matching Java Virtual Machines (2): 1.8.271.09 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home 1.8.0_271 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
I was facing similar issue, that when I set my java_home as
echo export "JAVA_HOME=\$(/usr/libexec/java_home)" >> ~/.bash_profile
it got set to /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
so I did it like echo export "JAVA_HOME="Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home" >> ~/.bash_profile
It result's into
Admins-MacBook-Pro:carot arun$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
You can also edit it in future if required go to your user, in my case arun folder press command + shift + . to see hidden files open .bash_profile in any of your favourite editor