i have macbook pro and have set java and java home. now it says that your JAVA_HOME is not set correctly. i want to completely remove java and install it again. how can i do this? Thanks.
2 Answers
This sounds like a Java based tool like ant or maven not being able to locate the JDK.
It does not mean you have to reinstall Java (which by the way is pretty hard for OS X) but that you should set your environment variables properly.
For a one shot, just set
export JAVA_HOME=/Library/Java/Home
in your shell, and then run ant or maven in your shell.
3 Comments
Mehdi Ijadnazar
i did that. and maven could locate it. but when i quit terminal and run it again maven gets confused. so i put the following in my .profile :
Mehdi Ijadnazar
file: "export JAVA_HOME=/System/Library/Frameworks/JavaVM.frameworks/Version/1.6.0_22/HOME" but again when i quit terminal and run it again and type " echo $JAVA_HOME " it shows the wrong java home and maven gets confused again. i can't figure out what is wrong.
Thorbjørn Ravn Andersen
Then it is the wrong configuration file. Use
.bashrc instead.
JAVA_HOMEto/Library/Java/Home