How to update sun jdk 7 on Ubuntu 12.04

java logo

Oracle has releasedĀ  JDK 7 Update 6 with JavaFX 2.2 Final for GNU/Linux, Mac OS X and MS Windows last week. I have already written how to install Sun JDK 6-7 on Ubuntu 12.04. I want to write how to update JDK 7 Update 6 manually.

Update JDK 7u6:

If you want to manually upgrade to a new version, first uninstall the JDK 7 and then reinstall. You can check your java version in console "java -version” or online here: Verify java version

Package manager: Those who have already installed an older version of Sun Java via the package manager, removes the same way.

  • First, close the web browser (because of java browser plugin).
  • Remove the Java version from the alternatives system:
sudo update-alternatives --remove "javac" "/usr/lib/jvm/jdk1.7.0_04/bin/javac"
sudo update-alternatives --remove "java" "/usr/lib/jvm/jdk1.7.0_04/bin/java"
sudo update-alternatives --remove "javaws" "/usr/lib/jvm/jdk1.7.0_04/bin/javaws"
  • Remove the browser plugin link:
sudo rm /usr/lib/mozilla/plugins/
  • Remove the jdk directory:
sudo rm -rf /usr/lib/jvm/jdk1.7.0_04

Netbeans note: If you uninstall old JDK, NetBeans 7.2 is not starting. Open the netbeans.conf file under etc directory and change theĀ netbeans_jdkhome parameter to the new jdk path.


Happy coding.

Leave a Reply