进行mvn全新安装并获得:
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
最佳答案
我将下载Oracle JDK 1.8.0_05的.bin文件,然后将其解压缩到/opt/jdk/jdk1.8.0_05。然后,使用“ alternatives --install blah blah”来执行将其附加到PATH的操作,以在系统上设置默认Java。