Ubuntu安装JavaJDK
root@Ubuntu:/opt/jdk/jdk1.8.0_181# vi /etc/profile
配置相关参数
#JAVAexport JAVA_HOME=/opt/jdk/jdk1.8.0_181
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
5、使配置文件生效
root@Ubuntu:/opt/jdk/jdk1.8.0_181# source /etc/profile
6、查看Java版本
root@Ubuntu:/opt/jdk/jdk1.8.0_181# java -versionjava version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
以上是 Ubuntu安装JavaJDK 的全部内容, 来源链接: utcz.com/z/513615.html