1, first go to the Oracle official website to download the Linux version of the 32-bit JDK: jdk-7-linux-i586.rpm, as shown in:
2. Decompress this package, decompress it into a folder, put the folder below: jdk-7-linux-i586/usr/Java/jdk1.7.0
Copy to:/usr/lib/JVM
3. Execute the following commands on the terminal:
Sudo add-Apt-repository PPA: nilarimogard/webupd8
Sudo apt-Get update
Sudo apt-Get Install update-Java
4. Select the installed JDK
Run the following command:
Sudo Update-Java
The following dialog box is displayed:
Select jdk1.7.0 and click "OK ".
Next, JDK 1.7 is installed in the supervisor.
After the installation is complete, run the following command to check whether the installation is successful:
Java-version or javac-version
If the following information is displayed, the installation is successful.
However, if the following information is displayed, the installation is unsuccessful:
The solution is as follows:
1. First, make sure that the environment variables are correctly set:
Run the following command to modify and view data:
Sudo gedit/etc/environment
Set the file as follows:
Path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/Usr/lib/JVM/jdk1.7.0/bin"
Language = "zh_cn: Zh: en_us: en"
Classpath=.:/Usr/lib/JVM/jdk1.7.0/lib
Java_home=/Usr/lib/JVM/jdk1.7.0
However, there is another hidden place:
Rt. jar and tool. Jar under lib and JRE/lib in the JDK directory may be in this form.
Rt. Pack, tool. Pack
Decompress the package. For example, run the following command: unpack200 is a built-in decompression tool.
Unpack200 rt. Pack Rt. Jar
After decompression, try again:
Java-version
It should be OK.
I have installed JDK successfully.