Child pages
  • Install or Uninstall Java

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

After checking your Java Environment, downloaded and installed either an Oracle JDK or an Open JDK, now it's time to pack everything together.

At this point, you have a JVM installed below your /usr/lib/jvm directory and you've a jinfo file tuned to your needs with a unique priority number.

Anchor
Install
Install
Install

Now it's time to link /etc/alternatives with our new installed JVM. 

Anchor
InstallCommandLine
InstallCommandLine
Command Line

Usually one has to install each java commands, tools or libraries one by one with the following interactive command:

...

Code Block
languagebash
themeEmacs
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/default-java/jre/bin/java" 1073;

Check if your added JVM java command has been processed by running:

Code Block
languagebash
themeEmacs
user@machine:~$ update-alternatives --list java
/usr/lib/jvm/default-java/jre/bin/java
/usr/lib/jvm/java-8-openjdk-i386/jre/bin/java
/usr/lib/jvm/java-8-oracle/jre/bin/java
/usr/lib/jvm/ramdisk-java-8-oracle/jre/bin/java

Anchor

...

InstallScripting
InstallScripting
Scripting

Doing this task one by one is pretty tedious, we provide a shell script ito facilitate the work.

...

It means that ramdisk-java-8-oracle should be installed through the Update Alternatives mechanism before we can set the alternatives to default-java or you define a jinfo file with a different priority number.

Then check again that everything is correct with your Java Update Alternatives Environment.

Anchor
Uninstall
Uninstall
Uninstall

Now it's time to unlink /etc/alternatives with the JVM we want to uninstall. 

Anchor
UninstallCommandLine
UninstallCommandLine
Command Line

Usually one has to uninstall each java commands, tools or libraries one by one with the following interactive command:

Code Block
languagebash
themeEmacs
sudo update-alternatives --remove "java" "/usr/lib/jvm/default-java/jre/bin/java";

Anchor

...

UninstallScripting
UninstallScripting
Scripting

Doing this task one by one is pretty tedious, we provide a shell script ito facilitate the work.

...