Published this article is purely I dull, hope to install JDK later do not go so many twists and turns of the road, but also hope that the future generations to learn from.
1. Take JDK1.7 as the example
Specific website address: http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
PS: The circle to be selected before downloading. Because it is installed in Linux, it can be selected according to the specific. I chose jdk-7u79-linux-i586.tar.gz.
2. If you are installing the JDK directly in a Linux system, you can omit it, as I am using a remote installation of the JDK for a few more steps
I. Enter the Linux system, I use the ubunte system. Open the command console shortcut key ctrl+alt+t
This does not primarily address the 22 port is not turned on, remote access to the host. Need to install the service, use the command sudo apt-get install openssh-server
The main thing is to install the SSH server, you can use tab auto-completion
Ii.linux Upload Tool filezilla ftp,linux Remote Command Action tool Xshell install the system with users, access with user and password
III. Log in to Xshell, using mkdir software to create a folder named software for the JDK (PS: All commands are in Xshell operation).
Uploading jdk-7u79-linux-i586.tar.gz to the machine using FileZilla FTP
3. Because we jdk-7u79-linux-i586.tar.gz file suffix is tar.gz, so use the command TAR-XZVF jdk-7u79-linux-i586.tar.gz decompression tar.gz, will be placed in the current directory.
After the decompression, use the command LS to view the directory files, found a jdk1.7.0_79 file. We enter the directory CD jdk1.7.0_79, enter after using pwd, will show you the path to copy the next path,
Configure the JDK environment variables to be used. All the students in Java know
4. The above files are ready, and the environment variables are left. It's a bit of a hole here, it's all tears.
I. Environment variable Setting 1
Http://www.cnblogs.com/cloudwind/archive/2012/10/19/2731263.html This article is about /etc/profile.d/development.sh Create the file and store the environment variables.
Well, mine doesn't work. and creating a file in PROFILE.D requires the root user sudo passwd root can reset the password, the newly installed classmate can use. The su root can be switched to the root user.
II. Environment variable Settings 2
#Vi/etc/profile
Add the following content to the inside
Export java_home=3. Path obtained by using PWD in
Export Jre_home= $JAVA _home/jre
Export classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATH
Export path= $JAVA _home/bin: $JRE _home/bin: $PATH
Source/etc/profile
This is a read-only file, you need to modify the permissions before executing chmod a+w/etc/profile (u means user, a for all, G for Group, R for readable, W for writable, X for executable),
Although it can be modified but not saved. This heart is cool ... Using SU root to switch to the root user, and then the vi/etc/profile operation on it, after the modification is completed use : EQ exit and save
III. environment variable settings 3
Http://zhidao.baidu.com/link?url=gWWKaReC0hP1UQ75DR12brxy8ekDLS3cjo8EprrZe-4Xnzi4bzrI-O_yl0HiR9WRWnI0mf0ElQdZQ3VzvcsSKa
I am the above 2 can not be used, all I have seen this after the implementation of the use. The main:
Vim~/.bashrc
Add the following at the end of the file:
Export java_home=3. Path obtained by using PWD in
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 the exit and enter the following command to take effect immediately. SOURCE ~/.BASHRC
5. After installation, see if it is successful. java-version can view JDK version
Linux installation JDK1.7