Installation record of Virtual Machine jdk and tomcat

Source: Internet
Author: User

Download jdk http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.

Shared directory

Copy the jdk file in the shared directory to the/tmp directory for installation.

Cp, mnt, hgfs, linuxsoft, jdk-7u21-linux-i586.rpm, tmp/

Go to the/tmp directory and install

Yeshang:/mnt/hgfs/linuxsoft # cd/tmp/

Yeshang:/tmp # rpm-ivh jdk-7u21-linux-i586.rpm

Set environment variables after installation

# Vi/etc/profile

Add at the end

# Set java environment

JAVA_HOME =/usr/java/jdk1.7.0 _ 21

CLASSPATH =.: $ JAVA_HOME/lib. tools. jar

PATH = $ JAVA_HOME/bin: $ PATH

Export JAVA_HOME CLASSPATH PATH

Save and exit.

Edit the java. sh script

Vi/etc/profile. d/java. sh

Enter the following content in the new java. sh file:

# Set java environment

JAVA_HOME =/usr/java/jdk1.7.0 _ 21

CLASSPATH =.: $ JAVA_HOME/lib/tools. jar

PATH = $ JAVA_HOME/bin: $ PATH

Export JAVA_HOME CLASSPATH PATH

Check whether JDK is successfully installed.

# Source/etc/profile // make the current configuration take effect immediately

# Java-version

Yeshang:/usr/java/jdk1.7.0 _ 21 # java-version

Java version "1.6.0 _ 20"

OpenJDK Runtime Environment (IcedTea6 1.9.7) (SUSE-1.2.1-i386)

OpenJDK Client VM (build 19.0-b09, mixed mode)

Install 1.7 to display 1.6 ???

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.