Ubuntu jdk environment variables configure virtual machine vm

decompress jdk
Ubuntu jdk environment variables configure virtual machine vm

Open the terminal in the jdk folder and enter the pwd command to copy the path of the jdk

Ubuntu jdk environment variables configure virtual machine vm

Obtain root privileges and enter /etc Modify the profile text in /etc and
add the following at the end
export JAVA_HOME=/home/runqi/jdk1.8.0_161

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

export PATH=$JAVA_HOME/bin:$PATH

Load the variable just set

Terminal input command source /etc/profile

Enter java -version to check whether the configuration is successfulUbuntu jdk environment variables configure virtual machine vm

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324641456&siteId=291194637