|
Linux 1. Install JDK start downloading jdk (jdk-1_5_0_02-linux-i586.rpm), recommended SUN's official website www.sun.com, download on the / home directory, of course, elsewhere row.
Enter the installation directory
#cd / home
#cp jdk-1_5_0_02-linux-i586.rpm / usr / local
#cd / usr / local
For all users to add executable permissions
#chmod + x jdk-1_5_0_02-linux-i586.rpm.bin
#. / Jdk-1_5_0_02-linux-i586.rpm.bin
Permissions will be generated, the file jdk-1_5_0_02-linux-i586.rpm, the same for all users to add an executable
#chmod + x jdk-1_5_0_02-linux-i586.rpm
Setup
#rpm -ivh jdk-1_5_0_02-linux-i586.rpm
Installation protocol appears, press to accept.
Linux install JDK Step 2. Set the environment variable.
#vi / etc / profile
In the last plane to join
#set java environment
JAVA_HOME = / usr / java / jdk-1_5_0_02
CLASSPATH =:. $ JAVA_HOME / lib.tools.jar
PATH = $ JAVA_HOME / bin: $ PATH
export JAVA_HOME CLASSPATH PATH
Save and exit.
For JDK all users use, it can be:
vi /etc/profile.d/java.sh
Enter the following in a new java.sh in:
#set java environment
JAVA_HOME = / usr / java / jdk-1_5_0_02
CLASSPATH =:. $ JAVA_HOME / lib / tools.jar
PATH = $ JAVA_HOME / bin: $ PATH
export JAVA_HOME CLASSPATH PATH
Save and exit, and then assign permissions to java.sh: chmod 755 /etc/profile.d/java.sh
Linux install JDK Step 3. Use the echo command to check the situation in the terminal environment variable settings.
#echo $ JAVA_HOME
#echo $ CLASSPATH
#echo $ PATH
4. Check the JDK is installed successfully.
#java -version
If you see JVM version and related information, that the installation was successful! |
|
|
|