※ Note: The JDK can be as long as the 1.5 version
Download good JDK files
I'm using: Jdk-6u34-linux-i586.bin.
1, first use root permissions in the OPT directory to create a new tools directory
Under Ubuntu, first set the password for the root user
Command mode directly with Su, and then enter the password on it, like Ubuntu if you have not set a password for root, you can use the first user (it is the default permission to use the sudo command) to set the password, command: sudo passwd root
To create a directory:
[Email protected]:/opt$ su//switch to root user to create directory
Password://Enter root password, password not visible
[Email protected]:/opt# mkdir Tools//Create Directory
Drag the Jdk-6u34-linux-i586.bin from the host to the virtual machine desktop before copying into the tools directory
[Email protected]:/opt# sudo cp/home/ubuntu-2/desktop/jdk-6u34-linux-i586.bin/opt/tools
Enter the/opt/tools directory, assign permissions to the file,
[Email protected]:/opt# cd/opt/tools
[Email protected]:/opt/tools# chmod u+x Jdk-6u34-linux-i586.bin
Execute the following command, and after execution completes, the JDK folder will be generated in the/opt/tools directory
./jdk-6u34-linux-i586.bin
To configure the JDK environment command:
[Email protected]:/opt/tools# sudo gedit/etc/profile
To enter the profile file, change the file:
Export java_home=/opt/tools/jdk1.6.0_34
Export Jre_home= $JAVA _home/jre
Export classpath= $JAVA _home/lib: $JRE _home/lib: $CLASSPATH
Export path= $JAVA _home/bin: $JRE _home/bin: $PATH
Save file, close
Execute the following command to make the configuration file effective:
[Email protected]:/opt/tools# source/etc/profile
Or:
. /etc/profile
Create a new command-line window to see if the installation configuration was successful
Tip: If what appears, you will need to choose to install the JDK, which means that Javac found more than one, not sure which
Resolution: Execute
[Email protected]:/home/ubuntu-2# apt-get Install OPENJDK-6-JDK
Explanatory notes
At this point, congratulations, JDK installation succeeded
※ Note that the above commands are best done under the root user
Installation JDK for Hadoop Big Data