JAVA_HOME未正确定义 - mvn

时间:2014-04-22 20:44:14

标签: java maven

运行mvn clean install并获得:

konnor@konnor-laptop:~/workspace/automation$ mvn clean install
Error: JAVA_HOME is not defined correctly.
  We cannot execute /opt/jdk/bin/java

我对此做过一些研究,并没有找到解决方法,有人有任何想法吗?

其他一些信息:

konnor@konnor-laptop0:~/workspace/automation$ which java
/usr/bin/java

konnor@konnor-laptop:/opt/jdk$ ls -la
total 20
drwxr-xr-x 5 root root 4096 Apr 18 08:52 .
drwxr-xr-x 5 root root 4096 Apr 18 08:51 ..
drwxr-xr-x 2 root root 4096 Apr 18 08:52 bin
drwxr-xr-x 5 root root 4096 Apr 18 08:51 jre
drwxr-xr-x 3 root root 4096 Apr 18 08:52 man


konnor@konnor-laptop:~$ /opt/jdk/bin/java -version
bash: /opt/jdk/bin/java: No such file or directory


konnor@konnor-laptop:~/workspace/automation$ $JAVA_HOME
bash: /opt/jdk: Is a directory

1 个答案:

答案 0 :(得分:1)

我会下载Oracle JDK 1.8.0_05的.bin文件,然后将其解压缩到/opt/jdk/jdk1.8.0_05。然后,使用'替代方法尽可能地将其附加到您的PATH - 安装等等等等。用于在系统上设置默认Java。