I have Mac OS 10.8.4 when I type in terminal >java i got an error
Unable to locate an executable at "/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java/bin/java" (-1)
Have no idea where and when its missed...Few days ago everything was fine. How to fix that ? Is that because I installed java 1.7 ?
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
java -version