Today, I encountered many problems when installing Java JRE using the simple installation command of ubuntu, so I finally switched to using an offline package to install JRE.
The procedure is as follows:
First open http://www.java.com/en/download/linux_manual.jsp? Locale = en
The following link is displayed:
Click the 46.0mbit link and download the file to a jre-7u25-linux-i586.tar.gz compressed package. Run the following command to decompress the package:
Tar-xzvf jre-7u25-linux-i586.tar.gz
Then we get a jre1.7.0 _ 25 directory, as shown below:
Copy the directory to the/usr/lib/Java directory.
Next, use vim or gedit to modify the/etc/environment configuration file. Add the following environment variables to this file:
Java_home = "/usr/lib/Java/jre1.7.0 _ 25"
Classpath = "$ java_home/lib"
Path = "$ java_home/bin"
Run the following command to install the JRE:
Sudo Update-alternatives -- install/usr/bin/Java/usr/lib/Java/jre1.7.0 _ 25/bin/Java 300
In this way, the JRE is installed. However, there may be multiple jre in the system. to determine which one is used as the default JRE, you need to use the following command for Configuration:
Sudo Update-alternatives -- config Java
Select JRE as prompted, as shown in:
Now, JRE has been installed!