In linux, uninstall openjdk, install sunjdk, and configure environment variables. Generally, openjdk is installed in linux. However, in development, you must use sunjdk. In this case, you can only uninstall openjdk and install sunjdk. 1. query the existing installation version rpm-qa | grep jdk 2, uninstall openjdk sudo yum-y remove java-1.6.0-openjdk 3, install sunjdk into the downloaded jdk-6u18-linux-i586-rpm.bin package directory, execute sudo. /jdk-6u18-linux-i586-rpm.bin 4, set the default jdk (replace the underline location based on the main directory of java) alternatives -- install/usr/bin/java/usr/java/jdk1.6.0 _ 18/bin/java 1 alternatives -- install/usr/bin/javac/usr/java/jdk1.6.0 _ 18/bin/javac 1 5. Configure the jdk environment variable sudo vi/etc/profile and add the export JAVA_HOME =/usr/java/jdk1.6.0 _ 18 export PATH = $ JAVA_HOME/at the bottom of the file/ bin: $ PATH export CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. save and exit jar, and then execute the command to make it effective immediately: source/etc/profile