First, uninstall the virtual machine's own JDK environment
Specific commands:
Rpm-qa |grep java --Find Java information
rpm–qa|grep JDK --Find JDK information
If there is a dependency, the prompt cannot be uninstalled, use RPM-E--nodeps to uninstall.
Direct deletion without direct
For example:
Rpm–e–nodeps java-1_5_0-gcj-compat-1.5.0.0-56.58
Rpm-e java-1_5_0-gcj-compat-1.5.0.0-56.58
Second, install the JDK environment
1. Installation package website
I downloaded the RPM package (it looks the same anyway)
http://download.oracle.com/otn-pub/java/jdk/8u72-b15-demos/jdk-8u72-linux-i586-demos.rpm
2, download and then through the xftp and other tools to upload to a virtual machine location
I uploaded a Java folder under opt to hold the JDK file. (See yourself)
3, for this reason I set up the Java directory under the USR folder is the extracted JDK directory
4. Copy the JDK compressed package under Opt/java to Usr/java and unzip
Because the file is not authorized to authorize the file first
RPM Jdk-6u43-linux-x64-rpm.bin
chmod +x Jdk-6u43-linux-x64-rpm.bin
Execute./jdk-6u43-linux-x64-rpm.bin start installing JDK
5. Configure Environment variables
Linux-vjns:/usr/java # Vi/etc/profile
#set Java Environment
Java_home=/usr/java/jdk1.6.0_32
Classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar
Path=$java_home/bin:$path
export java_home CLASSPATH PATH Save exit.
6. Use the echo command at the terminal to check environment variable settings.
#echo $JAVA _home #/opt/java/jdk1.1.7.0_79
#echo $CLASSPATH #.:/ Opt/java/jdk1.1.7.0_79/lib/dt.jar:/opt/java/jdk1.1.7.0_79/lib/tools.jar
#echo $PATH
#/opt/java/jdk1.1.7.0_79/bin:/opt/java/jdk1.1.7.0_79/bin:/opt/java/jdk1.1.7.0_79/bin:/sbin:/usr/sbin/local/ sbin:/root/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/x11:/usr/x11r6/bin:/usr/games:/usr/lib6/jre/bin:/usr/lib/ Mit/bin:/usr/lib/mit/sbin
4. Check that the JDK is installed successfully.
#java-version
Java Version "1.6.0_43"
Java (TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot (TM) 64-bit Server VM (build 20.14-b01, Mixed mode)
#javac-version
Javac 1.6.0_43
If you see the JVM version and related information, the installation is successful!
OpenSUSE Install Java environment variable JDK