Install JDK

  
under RedHat Enterprise Linux server 5.4

First, system environment operating system
: RedHat Enterprise Linux server 5.4 (rhel 5.4)
Second, install JDK1. Download from www.oracle.com The latest Java SE Development Kit 7 jdk-7-linux-i586.rpm2. Copy the JDK installation file jdk-7-linux-i586.rpm to any directory in Redhat. For example: /opt/jdk (directory jdk needs to be manually created) 3. Execute rpm -ivh jdk-1_5_0_17-linux-i586.rpm At this point, the system will start to install JDK. After the installation is complete, you can find a new folder named java in the /usr directory. This folder is the installed JDK directory. 4. Set the environment variable a. Go to the /etc folder, find the file profile and open it (command: #vi profile). b. Locate the export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC and change it to the following form (press i to have the editor plugged in):

JAVA_HOME=’/usr/java/jdk1.7.0′PATH=$JAVA_HOME/Bin:$PATHCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport JAVA_HOMEexport PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC CLASSPATH

Press ESC to exit edit mode and type at the end of the file: Wq Enter to save and exit vi
5. After setting, save the file. After restarting Redhat (or use source /etc/profile to make the configuration file take effect immediately), log in to the control terminal and type: java -version; if java version <;1.7.0” is displayed, your JDK has been successfully installed! If the version number cannot be displayed properly, it may be because the system comes with jdk1.4.2 and needs to be uninstalled before using java -version to see the correct version number rpm -e –nodeps java-1.4.2-gcj-compat-1.4.2.0 -40jpp.115.i386source /etc/profilejava -version will see the correct version number! ~

Copyright © Windows knowledge All Rights Reserved