This Article shows you How to Switch/Change between Multiples Java Versions on Mageia Linux Desktop.
The Process Make Use of the update-alternatives Package Java Versions Manager.
The Content give Focus Only to the Essentials Instructions and Commands to make it Easier to Follow.
-
Open a Terminal Window
-
Login as SuperUser
su
If Got “User is Not in Sudoers file” then see: How to Enable sudo
-
Switch of Java Release
- Switching to Classical Open-Java Versions Installed by the Mageia Packages
Example:
update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7*/bin/java 1065
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7*/bin/javac 1065
update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.7*/bin/jar 1065
update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7*/bin/javaws 1065
By Default the Open-Java JDK Packages are Automatically Installed Under: /usr/lib/jvm.
- Switching to Oracle Java Official Release Versions
How to Install Oracle Java JDK on Mageia Linux:
Installing Oracle-JDK7 on MageiaExample:
update-alternatives --install /usr/bin/java java /usr/java/jdk1.7*/bin/java 1065
update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.7*/javac
update-alternatives --install /usr/bin/jar jar /usr/java/jdk1.7*/bin/jar 1065
update-alternatives --install /usr/bin/javaws javaws /usr/java/jdk1.7*/javaws
By Default the .rpm Oracle Java JDK Packages are Automatically Installed Under: /usr/java.
- Switching to Classical Open-Java Versions Installed by the Mageia Packages
Mageia Linux How to Getting-Started Installing New Packages/Software.