Open the terminal in Ubuntu, execute the following command, or use Adept/the new software manager to search for "sun-java6-jre" and "sun-java6-jdk" and tag the installation. Sudoapt-getinstallsun-java6-jre if the space is rich, it is recommended to install a JDK. Sudoapt-getinstallsun-java6-jdk tip: During installation you need to answer whether to agree to use the Protocol (terminal in red)
Open the terminal in Ubuntu, execute the following command, or use Adept/the new software manager to search for "sun-java6-jre" and "sun-java6-jdk" and tag the installation.
Sudo apt-get install sun-java6-jre
If the space is rich, we recommend that you install a JDK.
Sudo apt-get install sun-java6-jdk
Tip: During the installation process, you need to answer whether you agree to use the Protocol (the red-blue prompt page in the terminal). Press the tab key to OK, and press enter to install it normally.
Set the current default java interpreter:
Sudo update-alternatives -- config java
The following figure is displayed after execution:
There are 2 alternatives which provide 'java'. Selection Alternative
1/usr/bin/gij-wrapper-4.1 * + 2/usr/lib/jvm/java-6-sun/jre/bin/javaPress enter to keep the default
, Or type selection number:
Enter the number before the row containing "sun. As shown above, enter 2 and press enter to confirm.
Configure JAVA environment variables:
Sudo gedit/etc/environment
Add the following two lines:
CLASSPATH =.:/usr/lib/jvm/java-6-sun/libJAVA_HOME =/usr/lib/jvm/java-6-sun
Sudo gedit/etc/jvm
Convert
/Usr/lib/jvm/java-6-sun
Enter this line at the top of the configuration block.
Install the browser's JAVA Plugin (optional ):
Sudo apt-get install sun-java6-plugin