1. Find the installed JDK
Rpm-Qa | grep JDK
2. Download JDK. Make sure to select
Omitted
3. Installation
Chmod + x jdk-6u31-linux-x64-rpm.bin supervisor change permissions
./Jdk-6u31-linux-x64-rpm.bin plugin installation
Install
/Usr/Java/Default
4. Switch from openjdk to Sun JDK
Alternatives -- install/usr/bin/Java/usr/Java/default/bin/Java 1
Alternatives -- install/usr/bin/javac/usr/Java/default/bin/javac 1
5. Select the desired version.
Alternatives -- config Java
6. view the applied version
Java-version
7. Set environment variables for System Configuration
VI/etc/profile
Add the following lines at the end:
Export java_home =/usr/Java/Default
Export classpath =.: $ java_home/JRE/lib/RT. jar: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin
Reboot reboot machine configuration takes effect