Step 2 of Linux Learning (Java environment installation), linuxjava
Jdk: jdk-8u131-linux-x64.rpm
Note: The following operations are performed under the root user or a user with root permissions:
I. Copy the dk-8u131-linux-x64.rpm to the/home Directory
Cp jdk-8u131-linux-x64.rpm/home/
Ii. decompress the rpm file
Rpm-ivh jdk-8u131-linux-x64.rpm
3. environment variable configuration
Note: environment variable configuration is a little troublesome, but it is not particularly difficult.
1. Enter the following command to enter the configuration file.
Vim/etc/profile
2. After Entering the configuration file, it is not editable. To edit the data, enter 'I first. The insert word is displayed below, and you can insert it. Add the following code to the configuration file (remember to change the path to your own installation path ).
JAVA_HOME =/usr/java/jdk1.8.0 _ 131 CLASSPATH =. :/usr/java/jdk1.8.0 _ 131/jre/lib/rt, jarPATH = $ PATH/usr/java/jdk1.8.0 _ 131 ecport path classpath JAVA_HOME
3. Press 'esc 'After the insert operation, switch to the non-insertion status, and save and exit after entering': wq.
4. Enter javac to check whether the configuration is successful.