How to uninstall your own JDK and install the desired JDK under Linux

Source: Internet
Author: User

How to uninstall your own JDK and install the desired JDK under Linuxafter installing the Linux system, the system has its own JDK version, because some of the software in the system needs to use this environment. But when we install Eclipse and Tomcat, it's not possible to use this JDK. At this point we need to install our own downloaded JDK, but before that we need to uninstall the JDK that comes with the system.Tools/Materials
    • centos6.x This version of the Linux system
    • JDK, download URL: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html, select the version you need to download
    • The following installation is shown in RPM package, so please download the rpm package file.
Method/Step
    1. 1
First Look at the Java version of the system:java-version; then use:rpm-qa | gcj command to view specific information, and finally use:rpm-e--nodeps java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64 Uninstall.
    1. 2
Drag the download RPM package into the Linux system and proceed to the appropriate directory:RPM-IVH jdk-7u51-linux-x64.rpm
    1. 3
after installation, configure the environment variable: Execute the vi/etc/profile command to add the configuration information such as. Note: The directory to write your own installation directory, the general default is installed under the/usr/java. java_home=/usr/java/jdk1.7.0_45Tomcat_home=/home/syx/server/tomcatpath= $JAVA _home/bin: $PATHclasspath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarExport Java_homeExport Tomcat_homeExport PATHExport CLASSPATH
    1. 4
If you do not want to re-system, you can use the command source/etc/profile to make the configuration file effective immediately. Otherwise, the system can only be restarted for the configuration parameters to take effect. We can then use echo $JAVA _home; echo $PATH; echo $CLASSPATHto view the configuration information.
    1. 5
Finally we pass:java-version See if we have successfully installed the JDK.

How to uninstall your own JDK and install the desired JDK under Linux

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.