Build a JDK environment using Centos
Centos7.0 & jdk1.8.0 _ 45
1. Upload the downloaded jdk package to the centos operating system through ssh.
Here is jdk-8u45-linux-x64.tar.gz download link: http://www.Z? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> watermark + Cgo8cD4yoaK9 + NDQveLRuTwvcD4KCgoKPHByZSBjbGFzcz0 =" brush: java; ">tar -vxzf jdk-8u45-linux-x64.tar.gz
Obtain the jdk1.8.0 _ 45 folder, as shown in.
3. Edit System Environment Variables
vim /etc/profile
Add the following at the end of the file:
Export JAVA_HOME =/root/jdk1.8.0 _ 45 // you can change the export PATH according to the position of your jdk package. export PATH = $ JAVA_HOME/bin: $ PATH
4. Run the command./etc/profile.
Note: there is a space between. And /.
If the current directory is in/etc/, you can directly execute./profile. Here, there is no space between. And /.
5. Enter java-version for testing.
The above words are displayed, indicating that the configuration is successful!