Note: RPM and software-related commands are equivalent to software Assistant management software under Windows
1 See if the current Linux system has Java installed
1) in the command window, you can view the OPENJDK version information that comes with the system.
Java-version
2) You can also view the Java files installed on the Linux system by typing the name on the command line
Rpm-qa | grep java
Name Interpretation: Rpm-qa | grep java
RPM Management Suite
-qa use Inquiry mode to query all packages
Grep finds eligible strings in a file
Java finds files that contain Java strings
2 Uninstall two openjdk installed on the Linux system
1) Enter the command rpm-e--nodeps the software to be uninstalled
The name of the software to uninstall
Noarch files can not be deleted
Command explanation:
RPM Management Suite
-e Delete the specified package
--nodeps does not verify the correlation of the suite files
3 uploading JDK to Linux system is done directly on the Remote connection tool
4 Creating the Java installation directory under Usr/local
5unzip the JDK to/usr/local/java
has been extracted to the specified folder
6 Modifying file names
The original is a bit too long, the name modification is shorter.
7 Configuring Environment variables
1 at the command line type: Vim/etc/profile Enter file---naming mode
Vim/etc/profile
Command Description:
Vim text editing
/etc/profile global variable file
into the text editing state, the cursor goes to the last line of the file, the keyboard press I:-----edit mode--"Edit the file
I
Paste the following content code in:
Note:java_home=/usr/local/java/jdk1.7 This is the installation directory for your JAVA files.
#set Java Environmentjava_home=/usr/local/java/jdk1.7classpath=.: $JAVA _home/lib.tools.jarpath= $JAVA _ Home/bin: $PATHexport java_home CLASSPATH PATH
After pasting in, press ESC to enter the bottom row mode
Input: Then enter Wq write and save
8 Let the environment variable you just set take effect
Type the following command:
Source/etc/profile
9 Verify that the configuration is successful
Here, the JDK under Linux is installed successfully.
003-linux the JDK installation process