装JDK最好把原来的OpenJDK删除。
The link has instructions for installing Oracle JDK, the Java 7 browser plugin and how to revert the changes.
So here is a tested (under Ubuntu 11.04 and 11.10) and working solution for installing Oracle JDK 7 and all its files so "javac" and everything else works: How To Install Oracle Java 7 (JDK) In Ubuntu
Here are the commands (just for convenience):
- Download the latest Oracle JDK 7 from here.
- Extract the downloaded Oracle Java JDK archive in your home folder - a new folder called "jdk1.7.0_03" (for Java JDK7 update 3) should be created. Rename it to "java-7-oracle" and move it to /usr/lib/jvm using the following commands:
cd sudo mkdir -p /usr/lib/jvm/ #just in case sudo mv java-7-oracle/ /usr/lib/jvm/3. Install Update Java package created by Bruce Ingalls (packages available for Ubuntu 11.10, 11.04, 10.10 and 10.04):
sudo add-apt-repository ppa:nilarimogard/webupd8 sudo apt-get update sudo apt-get install update-java4. Now run the following command in a terminal to install Oracle Java JDK:
sudo update-java
After a few minutes, Oracle Java JDK should be successfully installed on your Ubuntu machine. You can check out the version by running these commands in a terminal:
java -version javac -version

浙公网安备 33010602011771号