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.
InstallNow it's time to link /etc/alternatives with our new installed JVM.
...
Code Block |
---|
|
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 |
---|
| installDefaultJavaAlternatives.sh |
---|
| installDefaultJavaAlternatives.sh |
---|
|
installDefaultJavaAlternatives.sh
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.
UninstallNow it's time to unlink /etc/alternatives with the JVM we want to uninstall.
...
Code Block |
---|
|
sudo update-alternatives --remove "java" "/usr/lib/jvm/default-java/jre/bin/java"; |
Anchor |
---|
| removeDefaultJavaAlternatives.sh |
---|
| removeDefaultJavaAlternatives.sh |
---|
|
removeDefaultJavaAlternatives.sh
Doing this task one by one is pretty tedious, we provide a shell script ito facilitate the work.
...