Because openjdk is not available for Hadoop development, it must be replaced with sun's jdk. Therefore, install sunjdk first: Add repositoryadd-apt-repository "debhttp: // archive.canonical.com/lucidpartner "Pay attention to the version and install sun-jdkapt-getupdateapt-getinstallsun-
Because openjdk is not available for Hadoop development, you must replace it with sun's jdk. Therefore, install sunjdk first:
First, add repository.
Add-apt-repository "deb http://archive.canonical.com/lUcidPartner"
Note version
Then install sun-jdk
Apt-get update
Apt-get install sun-java6-jdk sun-java6-plugin
After installation, manually change to sunjdk:
Method 1:
Update-java-alternatives-s java-6-sun
(Or sudo update-alternatives -- config java, select it by yourself)
Because I was not optimistic about the installation process, the computer automatically restarted. As a result, the Ubuntu on the virtual machine was shut down abnormally, and the installation process may be faulty. As a result, when I use this method for conversion after the restart, display Error:
Update-alternatives: Error: No-javaplugin. so candidate item.
So I chose the second method:
Www.linuxidc.com @ linux:/etc/java-6-sun $ sudo update-alternatives -- config java
Three candidate items can be used to replace java (/usr/bin/java ).
Select the path priority status
------------------------------------------------------------
/Usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 automatic mode
/Usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
* 2/usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
/Usr/lib/jvm/java-7-openjdk-i386/jre/bin/java 1051 manual mode
To maintain the current value [*], press the Enter key or enter the selected number: 2
Www.linuxidc.com @ linux:/etc/java-6-sun $ java-version
Java version "1.6.0 _ 26"
Java (TM) SE Runtime Environment (build 1.6.0 _ 26-b03)
Java HotSpot (TM) Client VM (build between 1-b02, mixed mode, sharing)