linux environment install jdk configure jdk environment variables

Install jdk in linux environment and configure jdk environment variables

jdk1.8 download address: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

This is what I downloaded before and you can leave a message if you need it. The
Insert picture description here
following is the installation of jdk:

First upload the package to the virtual machine: my upload location -->/usr/local/java

Unzip jdk: tar -zxvf jdk-8u11-linux-x64.tar.gz
configure environment variables: vi /etc/profile
add in the /etc/profile file:

export JAVA_HOME=/usr/local/java/jdk1.8.0_11

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Insert picture description here

Save and exit in the enable file:source /etc/profile

Insert picture description here
Test it: javac -version
Insert picture description here
jdk environment installation is complete

Guess you like

Origin blog.csdn.net/xaiobaicai/article/details/114117936
Recommended