Virtual Machine Linux ---- Ubuntu1204 ---- install jdk1.8, ubuntu install jdk1.8
1. Introduction
Here we will mainly talk about how to install jdk1.8 using the compressed package in Ubuntu1204 and run the rpm directly.
2. Steps
Download 2.1
Address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-%3151.html, download the 64-bit compressed package in linuxenvironment, jdk-8u45-linux-x64.tar.gz
Upload 2.2
You can use the xftp tool to copy files to the linux environment. Here, I put them in my own directory. Note that you may be prompted that you do not have the permission to upload files. Just grant the folder write permission.
2.3 decompress
Tar-zxvf jdk-8u45-linux-x64.gz # The directory after decompression is:/app/programs/jdk1.8.0 _ 45
2.4 configure Environment Variables
vi /etc/profile
Add the following code at the bottom of the file:
#set java environmentexport JAVA_HOME=/app/programes/jdk1.8.0_45export JRE_HOME=${JAVA_HOME}/jreexport CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexport PATH=${JAVA_HOME}/bin:$PATH
Save and exit.
2.5 make the configuration file take effect (sometimes the execution may fail. Restart is recommended)
source /etc/profile
2.6 Test
java -version
If the jdk version information is output, it indicates that the jdk version is successful.