Install and configure JDK1.7.0 _ 55 in Linux
1. Environment:
# Lsb_release-
LSB Version: core-4.0-amd64: core-4.0-ia32: core-4.0-noarch: graphics-4.0-amd64: graphics-4.0-ia32: graphics-4.0-noarch: printing-4.0-amd64: printing-4.0-ia32: printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.8 (Final)
Release: 5.8
Codename: Final
2. Download JDK:
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
3. Install JDK
Upload the downloaded java to the server;
# Mkdir/usr/java
# Rpm-ivh jdk-7u55-linux-x64.rpm
4. Set Environment Variables
All users:
Cat/etc/profile. d/java. sh
# Set java environment
JAVA_HOME =/usr/java/jdk1.7.0 _ 55
JAVA_BIN =/usr/java/jdk1.7.0 _ 55/bin
CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
PATH = $ JAVA_BIN: $ PATH
Export PATH JAVA_HOME CLASSPATH
Chmod 755/etc/profile. d/java. sh
Single User:
$ HOME/. bash_profile File
5. Verification
# Java-version
Java version "1.7.0 _ 55"
Java (TM) SE Runtime Environment (build 1.7.0 _ 55-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
# Javac
# Java
This article permanently updates the link address: