Installing the JDK for a virtual machine on a Linux system under Windows system

Source: Internet
Author: User

When the Linux system is installed, the default JDK is usually provided. Now the default is version 1.8. Need to uninstall your own, and then install what you need.

1. Find the openjdk you want to uninstall:

# Rpm-qa | grep java

2: Unload in turn (these are all queries above)

RPM-E--nodeps Javapackages-tools-3.4.1-6.el7_0.noarch

RPM-E--nodeps Python-javapackages-3.4.1-6.el7_0.noarch

RPM-E--nodeps java-1.7.0-openjdk-1.7.0.75-2.5.4.2.el7_0.x86_64

RPM-E--nodeps Tzdata-java-2015a-1.el7.noarch

RPM-E--nodeps java-1.7.0-openjdk-headless-1.7.0.75-2.5.4.2.el7_0.x86_64

3: Check if clean is removed:

# Rpm-qa | grep java

4: Upload the JDK installation package jdk-7u79-linux-x64.tar.gz to/usr/java to extract:

(upload can be done via Xshell and FTP)

TAR-ZXVF jdk-7u75-linux-x64.tar.gz

5: Configure the JDK, edit the/etc/profile file, and add the following tail
Export java_home=/usr/java/jdk1.7.0_79

Export jre_home=/$JAVA _home/jre
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin: $JRE _home/bin

6: Reload/etc/profile:

# Source/etc/profile

7: Check that the JDK is installed successfully:

# java-version

Installing the JDK for a virtual machine on a Linux system under Windows system

Related Article

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.