I downloaded JDK for Mac OS X 10.9.1 from Oracle, but I had to install another Java from Apple site once more, as I couldn't launch eclipse with it.
These are two pages that I referred.
Now I have three java binaries installed in my computer.
Installation A
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
Installation B
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
Installation C
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
I found that I can easily remove Installation C, however I'm not sure if this is OK.
When I invoked java from command line, it points to Installation A.
java -version
java version "1.7.0_51"
ls -alF `which java`
lrwxr-xr-x 1 root wheel 74 Jan 15 09:12 /usr/bin/java@ -> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
- Is there any way to use just one JDK 1.7 for Mavericks by removing two of them safely?
EDIT
After some setup and test, I have only one Java (1.6) installed.
I have Installation B, and now Installation C is linked to Installation A.
For using eclipse, I had to make Compiler Compliance level to 1.6 to use it (from the help java.lang.UnsupportedClassVersionError Unsupported major.minor version 51.0).
EDIT2
This seems to what happened.
Installation of Apple Java
- Installation A
- Installation B is a symbolic link to A
Installation of Oracle Java
- Installation C
- Changed the Installation B that
- Created a
/System/Library/Frameworks/JavaVM.framework/Versions/A
- Copied files from Installation C (not symbolic link)
- Make a symlink Current to Versions/A
I tried to install Oracle Java only by removing Apple Java, but I got installation error, so I guess Apple Java is needed to install Oracle Java.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…