Believe yards farmers absolutely can not resist the temptation of Linux system, also in the world of Linux, Java, the following I will share with you about my jdk1.8 installation process, new contact with the Linux children's shoes are completely in accordance with the commands I provided in the picture to install OH ~ ~
Tools/Materials
Method/Step
- 1
The first step: Download the Linux environment jdk1.8, please go to the (official website) to download the JDK installation files;
Since my Linux is 32 bits, I download the jdk-8u25-linux-i586.tar.gz file.
As shown in the following:
- 2
Step Two: Create a new/usr/java folder, place the jdk-8u25-linux-i586.tar.gz in the folder, and switch the working directory to the/usr/java directory. As shown in the following:
command to use: TAR-ZXVF jdk-8u60-linux-x64.tar.gz
- 3
Step three: Through the above steps, jdk1.8 has been all installed, please remember the steps oh. As shown in the following:
- 4
Fourth Step: Configure the Environment variables: ①, edit the profile with Vim/etc/profile, as shown in the following 1 figure: ②, add the following at the bottom of the/etc/profile:
Java_home=/usr/java/jdk1.8.0_25
Path= $JAVA _home/bin: $PATH
Classpath= $JAVA _home/jre/lib/ext: $JAVA _home/lib/tools.jar
Export PATH java_home CLASSPATH
As shown in the 2 figure below:
- 5
Fifth step: Finally use Source/etc/profile to make the profile file effective immediately. As shown in the following:
- 6
Sixth step: Command Test,
①, command not found error is not present with JAVAC commands
②, using Java-version, appears as Java version "1.8.0_25"
③, Echo $JAVA _home, Echo $CLASSPATH, echo $PATH, see if your configuration is correct.
END
- ————— "Uninstalling the JDK" —————————————————————————————————
#rpm-Q JDK
#rpm-E--nodeps jdk-1.6.0_45-fcs.i586
Reconfirm: #rpm-Q JDK user confirms that the uninstallation was successful
Note the error messages that may occur:
BASH:./java:cannot Execute binary file
This error can occur because a 64-bit JDK is installed on a 32-bit operating system,
See if the JDK version and Linux version are the same number of bits.
To see if your Ubuntu installation is a 32-bit or 64-bit system:
sudo uname--m
i686//indicates 32-bit
x86_64//indicates 64-bit
- Note that the path in the configuration, it is necessary to put $java_home/bin in front, or use the Java command, the system will find the previous Java, do not look down. In this way, the JAVA executable file run directory is not $java_home/bin, and in other directories, will cause a lot of problems.
Install jdk1.8 under Linux