UBUNTU:无法设置JAVA_HOME值

时间:2018-02-07 14:08:48

标签: ubuntu java-home

在Ubuntu中,我安装了MavenJAVA 1.8,安装了它并编辑了/etc/environment文件以设置JAVA_HOME值。我的/etc/environment如下:

M2_HOME=/usr/share/maven
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin/java:$M2_HOME/bin"

which java给了我/usr/bin/java$PATH已经存在了ls -ltR /usr/bin/java

/etc/alternatives/java提供ls -ltR /etc/alternatives/java/usr/lib/jvm/java-8-openjdk-amd64/bin/java提供mvn -version

root@microservice-deploy:/etc# mvn -version Apache Maven 3.3.9 Maven home: /usr/share/maven Java version: 1.8.0_151, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.13.0-1008-gcp", arch: "amd64", family: "unix" 的快照如下:

JAVA Home

表示JAVA Home指向其他位置。

{{1}}变量到底在哪里?如何解决这个问题?

0 个答案:

没有答案