1. Prepare a pure Ubuntu system using Xshell to connect to the server
2. Install RPM, Resource Pack Manager
Direct Input Command:
Apt-get Install rpm
Also need to install Alien
Apt-get Install Alien
3. Download the JDK installation package jdk-7u79-linux-x64.rpm
It is said to be installed directly, using Alien-i jdk-7u79-linux-x64.rpm
But I was first converted into a Debain package and then installed.
Alien-d jdk-7u79-linux-x64.rpm
Dpkg-i Jdk-7u79-linux-x64.deb
Installation Successful
4. Configure Environment variables
Using the VI Editor to open/etc/profile
Input command: Vi/etc/profile
Press the I key to enter edit mode
At the end of the profile file, add:
Export java_home=/usr/share/jdk1.6.0_14
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Then press "ESC" key to exit Edit mode and enter: WQ press ENTER to save and exit
5. It's a little bit more of a pit daddy. After the JDK installation is successful, the two jar packages under the directory are not normal
A/usr/java/jdk1.7.0_79/lib under Tools.pack needs to be decompressed into Tools.jar.
A/usr/java/jdk1.7.0_79/jre/lib under Rt.pack needs to be decompressed into Rt.jar.
If the Java Virtual machine does not start, it will report
Error occurred during initialization of VM Java/lang/noclassdeffounderror:java/lang/object errors
Extract using Java's own unpack200 tool
Enter the command:
unpack200 Tools.pack Tools.jar
unpack200 Rt.pack Rt.jar
6. Finally reboot the system.
Reboot
Installing the JDK under Linux-ubuntu