

OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode) Thanks.It will show output like as below: openjdk version "1.8.0_252" It outputs the version correctly.Ĭould you please tell what is missing to have my own java version on the central point for all programs. The program ‘java’ can be found in the following packages:īut if I go to my home directory, where java is uncompressed and execute like >./java -version. If I run from console the command >java -version Now added the path to “PATH” variable in the /etc/environment file like below: Downloaded the jdk from following site and uncompressed to my home directory. I have unintalled the java from the system using above commands. I could not run my own installed java version. Let’s check that all OpenJDK packages have been removed. Edit the list of packages below if you have additional or different OpenJDK packages installed. Next, let’s uninstall OpenJDK related packages. sudo vi /etc/environmentĭelete the line with JAVA_HOME Uninstall OpenJDK (if installed)įirst we’ll check which OpenJDK packages are installed. Update-alternatives: error: no alternatives for javaws. Update-alternatives: error: no alternatives for javac. Update-alternatives: error: no alternatives for java.

cd /usr/lib/jvm sudo rm -rf jdk1.7.0_04 sudo update-alternatives -config java If you do this wrong, you could delete important system files, including those that are required by Ubuntu. You must type the next 2 commands perfectly to avoid permanently destroying your system. You should no longer see 1.7.0 u04 for the version of any of the above commands. java -version javac -version which javaws Let’s quickly verify that the commands above remove the symlinks. "/usr/lib/jvm/jdk1.7.0_04/bin/javac" sudo update-alternatives -remove "javaws" \ "/usr/lib/jvm/jdk1.7.0_04/bin/java" sudo update-alternatives -remove "javac" \ sudo update-alternatives -remove "java" \ However, you can remove the \ and then type each command on one line in the terminal. I have split the following commands onto multiple lines to ensure that they display correctly on this page. Next, we’ll remove each symlink to a Java binary from the Debian alternatives system. Slave java.1.gz: /usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/java.1.gzĬurrent 'best' version is '/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java'. usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java - priority 1051 Slave java.1.gz: /usr/lib/jvm/j2sdk1.6-oracle/man/man1/java.1.gz usr/lib/jvm/j2sdk1.6-oracle/jre/bin/java - priority 315 Link currently points to /usr/lib/jdk1.7.0_04/bin/java The output from the command will be something like: Let’s check the current setup before we uninstall Java. I have also included instructions for removing the OpenJDK at the bottom of this post. If you are using a different version of the JDK, then change the version numbers listed below.


How to uninstall openjdk 7 in ubuntu update#
These instructions are for the Oracle JDK 1.7.0 Update 4 on Ubuntu 12.04 LTS. Hopefully you won’t need these instructions due to a botched install, but there may come a time where you need to uninstall a version of the JDK/JVM.
