Recently in the study of Linux, Daoteng a half-day. Finally, the JDK is installed, write a blog record, the key is the JDK environment variable configuration and save the
I used the SECURECRT to connect Linux, and then securecrt on the command, about the use of SECURECRT, and then added on the blog
The following begins the text:
First, check if there is a JDK on your Linux machine, and uninstall it if you have one.
1. Check it to
[[email protected] ~]# Rpm-qa|grep GCJ or rpm-qa|grep java
Libgcj-4.1.2-44.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
2. Uninstall the JDK
[Email protected] ~]# yum-y remove java-1.4.2-gcj-compat-1.4.2.0-40jpp.115 or rpm-e--nodeps java-1.4.2-gcj-compat-1. 4.2.0-40jpp.115
Until I see the following sentence, even if it succeeds.
complete! (See this description complete.) )
3. Then download the Linux JDK
Http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
Two. Installing the JDK
When I download the RPM package
Then perform the installation (my JDK is placed under the Jdksource folder)
[Email protected] ~]# Cd/jdksource
[Email protected] jdksource]# RPM-IVH jdk-7u80-linux-x64.rpm
The flowers are ready to be installed without an accident.
Three. Configure environment variables (key)
#vi/etc/profile
In the profile file, add the following:
java_home=/usr/java/jdk1.7.0 (This is your own JDK path)
Jre_home=/usr/java/jdk1.7.0/jre
Path= $PATH: $JAVA _home/bin: $JRE _home/bin
Classpath=.: $JAVA _home/lib/jt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Export Java_home jre_home PATH CLASSPATH
Add complete save exit, this toss me for a long time:
Press ESC to enter WQ and then hit enter (Save and exit)
I can only do it this way.
Source/etc/profile, it won't work.
Four. Check if the environment variable is configured successfully
[Email protected] ~]# java-version
Java Version "1.7.0_80"
Java (TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.80-b11, Mixed mode)
Done!
Linux under JDK installation