Install jdk in centos 6.5 and jdk in centos

Source: Internet
Author: User

Install jdk in centos 6.5 and jdk in centos
Install jdk in linux


1. Download the linux jdk version:


Jdk-6u1-linux-i586




2. Transfer the jdk file to the server/usr/local/jdk [the usr non-internal program and the program outside the command are installed in this directory] Directory,
[No jdk directory to create one: mkdir jdk] send the file here




3. Enter the usr/local/jdk directory and enter the command:


Sh jdk-6u1-linux-i586.bin






4. Configure jdk information: Enter the command vi/etc/profile and add the following configuration at the end to [etc stores the configuration file in the system]


JAVA_HOME =/usr/local/jdk/jdk1.6.0 _ 01
PATH = $ JAVA_HOME/bin: $ PATH
CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME
Export PATH
Export CLASSPATH






5. Go to the usr/bin directory and run the command. [switch to the default jdk version. Run the command: If the jdk is installed in linux, switch to your own version]
Cd/usr/bin
Ln-s-f/usr/local/jdk/jdk1.6.0 _ 01/jre/bin/java
Ln-s-f/usr/local/jdk/jdk1.6.0 _ 01/bin/javac






6. Enter
Java-version
Screen output:


Java version "jdk1.6.0 _ 01"
Java (TM) 2 Runtime Environment, Standard Edition (build jdk1.6.0 _ 01)
Java HotSpot (TM) Client VM (build jdk1.6.0 _ 01, mixed mode)


Installation is complete ..........


You can directly configure it in tomact without having to configure it in etc/profile.

Modify three Tomcat configuration files: "tomcat/bin/catalina. sh" and "tomcat/bin/setclasspath. sh ".

1) add the following two sentences (JDK) to the blank space at the beginning of the catalina. sh file and setclasspath. sh file ):

export JAVA_HOME=/usr/local/java/jdk1.6.0_18export JRE_HOME=/usr/local/java/jdk1.6.0_18/jre

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.