Mehdi Ijadnazar
Mehdi Ijadnazar

Reputation: 4951

install java on mac os x

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.

Upvotes: 0

Views: 447

Answers (2)

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.

Upvotes: 0

Erik
Erik

Reputation: 2051

Put export JAVA_HOME=$(/usr/libexec/java_home) in your .profile and java_home will be set correctly.

Upvotes: 3

Related Questions