Linux uninstall openjdk install sunjdk and configure Environment Variables

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.