Check first: whereis java
, usually it is /usr/bin/java
Probably symbolic link for java
in /usr/bin
is not pointing to the right location. You can set this link manually to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
Also check other processes: javac
, javadoc
, javap
, javaws
and javah
.
Additionally you can define JAVA_HOME
in your .bash_profile
.
cd /usr/bin
ls -l | grep java
- check if it is indeed pointing to that wrong locationrm java
- delete symbolic linkln -s /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java java
- try
java -version