Remove All Java Versions

Remove All Java Versions Rating: 4,2/5 1517 votes
Active2 years ago
  1. Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ). Installing Java 7 in 16.04 and using multiple Java versions. Completely remove Java 9 from Ubuntu 17.10. Problem with uninstalling java. Hot Network Questions How slow was the 6502 BASIC compared to Assembly.
  2. To remove OpenJDK (the one you've already installed) sudo apt-get purge openjdk-. Make a new directory for your new JDK. Sudo mkdir -p /usr/local/java.

I have a Linux box on which Java 1.7 is installed:

But for some new tool I need to install the jdk-8u45-linux-x64.tar.gz

So how can I remove old one and install the new one?

It can with a single command-line remove all older versions of the program, without the need of third-party software. If you want to remove all Java-related software use the following line: wmic product where 'name like 'Java%%' call uninstall /nointeractive. We highly recommend that you uninstall all older versions of Java from your system. Keeping old versions of Java on your system presents a serious security risk. Uninstalling older versions of Java from your system ensures that Java applications will run with the latest security and performance improvements on your system. How can I remove. We highly recommend users remove all older versions of Java from your system. Keeping old and unsupported versions of Java on your system presents a serious security risk. Removing older versions of Java from your system ensures that Java applications will run with the most up-to-date security and performance improvements on your system.

ProgrammerProgrammer
3,31419 gold badges55 silver badges113 bronze badges

3 Answers

  1. To remove OpenJDK (the one you've already installed)

    sudo apt-get purge openjdk-*

  2. Make a new directory for your new JDK

    sudo mkdir -p /usr/local/java

  3. Copy the file to the directory (you should be in that file path)

    sudo cp -r jdk-8u45-linux-x64.tar.gz /usr/local/java/

  4. Extract the file

    Free english textbooks pdf. sudo tar xvzf jdk-8u45-linux-x64.tar.gz

  5. You should add this to your PATH now. To do that:

    a. Open /etc/profile : sudo gedit /etc/profile

    b. Scroll down (the end) and add the path where your jdk was installed

    JAVA_HOME=/usr/local/java/jdk1.8.0_45PATH=$PATH:$HOME/bin:$JAVA_HOME/binexport JAVA_HOMEexport PATH

    Save and exit

  6. Inform your Linux system where your Oracle Java JDK/JRE is located.

    a. Notify the system that Oracle Java JRE is available for use

    sudo update-alternatives --install '/usr/bin/java' 'java' '/usr/local/java/jdk1.8.0_45/bin/java' 1

    b. Notify the system that Oracle Java JDK is available for use

    sudo update-alternatives --install '/usr/bin/javac' 'javac' '/usr/local/java/jdk1.8.0_45/bin/javac' 1

    c. Notify the system that Oracle Java Web start is available for use

    sudo update-alternatives --install '/usr/bin/javaws' 'javaws' '/usr/local/java/jdk1.8.0_20/bin/javaws' 1Ti nspire software.

  7. Inform your Linux system that Oracle Java JDK/JRE must be the default Java.

    a. Set the java runtime environment for the system

    sudo update-alternatives --set java /usr/local/java/jdk1.8.0_45/bin/java

    b. Set the javac compiler for the system

    sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_45/bin/javac

    c. Set Java Web start for the system

    sudo update-alternatives --set javaws /usr/local/java/jdk1.8.0_20/bin/javaws

  8. Reload your system wide PATH

    source /etc/profile

  9. Check the new version and you're done!

    java -version

Ksheetij SainiKsheetij Saini

Just unpack the new Java version, for example into /opt. Then do

Remove all java versions windows 7

Put these exports into the startup files for your shell and you should be set. It is not necessary to uninstall the Java 7 installation.

user1907906

On Centos/Redhat

Java

First do : rpm -qa grep jdkAnd then : rpm -e <the version which you dont want>

ChaitanyaBhattChaitanyaBhatt

Not the answer you're looking for? Browse other questions tagged javalinux or ask your own question.

Active3 years, 6 months ago

Windows powershell command to uninstall all versions of Java except a specific version. This command should work in windows 7 & above.

The following command uninstalls all versions. How do I modify the following in such a way that a specific version 8.0.770.3 does not uninstall.

xyres
11.7k3 gold badges27 silver badges47 bronze badges
Vijay VatVijay Vat

1 Answer

MartinMartin
1,4683 gold badges10 silver badges21 bronze badges

Uninstall All Java Versions Mac

Not the answer you're looking for? Browse other questions tagged powershellpowershell-2.0 or ask your own question.