Home  >  Article  >  Java  >  How to install jdk1.8 under linux system

How to install jdk1.8 under linux system

王林
王林forward
2019-11-25 17:02:032213browse

How to install jdk1.8 under linux system

1. First download jdk1.8 from the official website

2. jdk configuration

Edit the profile in the etc directory and enter sudo vim etc/profile

Recommended related video tutorials: java course

How to install jdk1.8 under linux system

Press Enter to get the following picture:

How to install jdk1.8 under linux system

3. Press i or insert to insert the following content at the end of the file

Note that you only need to change the path of Javah_home

#Java Env
export JAVA_HOME=/usr/jdk1.8.0_121
export CLASSPATH=.:JAVAHOME/lib/dt.jar:JAVA_HOME/lib/dt.jar:JAVA 
H
 OME/lib/dt.jar:JAVA_HOME/lib/tools.jar
export PATH=PATH:PATH:PATH:JAVA_HOME/bin

Get the following picture:

How to install jdk1.8 under linux system

##After inserting, press Esc to exit editing, enter: wq and press Enter

How to install jdk1.8 under linux system

4. Finally enter

Java -version to check whether it is configured properly

How to install jdk1.8 under linux system

Complete!

Recommended related articles:

java entry program

The above is the detailed content of How to install jdk1.8 under linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete