I am developing an aplication in cocoa which uses some java classes .I am getting an error "JAVA_HOME is not defined correctly We cannot execute /System/Library/Frameworks/JavaVM.framework/Home/bin/java".I dont know how to resolve this..Please anyone help me..
Thanks in advance
export JAVA_HOME=`/usr/libexec/java_home` is exactly what you want to do.
In fact, all of the Apache projects (well, any project really) that hardcodes /System/Library/Frameworks/JavaVM.framework/Versions/... needs to use /usr/libexec/java_home if it exists. It's the only way you will know if Java is actually installed.
At some point in the future the symlinks in /System/Library/Frameworks/JavaVM.framework/Versions/ will be going away, which will even more severely break these projects if they want to load using an Oracle/OpenJDK JVM.
In your .bashrc file, add below lines:
export JAVA_HOME=/usr
export PATH=$PATH:$JAVA_HOME
This worked for me.
Add the following line to ~/.mavenrc
file
export JAVA_HOME=$(/usr/libexec/java_home)
Reference: Maven ignoring JAVA_HOME on OSX?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With