优麒麟配置java环境变量
查jdk安装路径
root@x390_13:58:29:~# which java
/usr/bin/java
root@x390_13:58:37:~# ls -lr /usr/bin/java
lrwxrwxrwx 1 root root 22 12⽉ 18 13:55 /usr/bin/java -> /etc/alternatives/java
root@x390_14:00:51:~# ls -lrt /etc/alternatives/java
lrwxrwxrwx 1 root root 43 12⽉ 18 13:55 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
输出是/etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-amd64/bin/java
确定java的安装⽬录是/usr/lib/jvm/java-11-openjdk-amd64
配置JAVA_HOME
vim /etc/profile
配置如下:
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
⽣效验证
java环境变量自动配置
echo $JAVA_HOME

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。