环境变量用哪个java -> /etc/alternatives/java_sdk lrwxrwxrwx 1 root root 32 Jun 6 17:31 java-1.8.0 -> /etc/alternatives/java_sdk_1.8.0 lrwxrwxrwx 1 root root 40 Jun 6 17:31 java-1.8.0-openjdk -> /etc/alternatives/java_sdk_1.8.0_openjdk drwxr-xr-x 7 root root 4096 Jun 6 17:31 java-1.8.0-openjdk-1.8.0.372.b07-1.0.1.al8.aarch64 lrwxrwxrwx 1 root root 34 Jun 6 17:31 java-openjdk -> /etc/alternatives/java_sdk_openjdk lrwxrwxrwx 1 root root 21 Jun 6 17:30 jre -> /etc/alternatives/jre lrwxrwxrwx 1 root root 27 Jun 6 17:30 jre-1.8.0 -> /etc/alternatives/jre_1.8.0 lrwxrwxrwx 1 root root 35 Jun 6 17:30 jre-1.8.0-openjdk -> /etc/alternatives/jre_1.8.0_openjdk lrwxrwxrwx 1 root root 54 Apr 26 12:03 jre-1.8.0-openjdk-1.8.0.372.b07-1.0.1.al8.aarch64 -> java-1.8.0-openjdk-1.8.0.372.b07-1.0.1.al8.aarch64/jre lrwxrwxrwx 1 root root 29 Jun 6 17:30 jre-openjdk -> /etc/alternatives/jre_openjdk
时间: 2024-03-10 08:44:08 浏览: 116
ubuntu8.04中配置java+tomcat+eclipseMyEclipse开发环境(更新)
你可以使用以下命令来设置环境变量为java-1.8.0-openjdk:
```
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
export PATH=$JAVA_HOME/bin:$PATH
```
这将把JAVA_HOME设置为java-1.8.0-openjdk的安装路径,并将其添加到PATH环境变量中,以便您可以在终端中运行Java命令。
阅读全文