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