我试图让Maven在我的Windows 7操作系统上运行。
$ mvn -v
which: no javac in (/jre/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/OpenSSH/bin:/cygdrive/c/Program Files (x86)/Symantec/VIP Access Client:/cygdrive/c/Program Files (x86)/Skype/Phone:/cygdrive/c/Program Files (x86)/apache-maven-3.3.9/bin: C:/Program Files (x86)/Java/jre1.8.0_91:/cygdrive/c/texlive/2016/bin/win32:/cygdrive/c/Users/anyoung/AppData/Local/Box/Box Edit)
which: no java in (/jre/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/OpenSSH/bin:/cygdrive/c/Program Files (x86)/Symantec/VIP Access Client:/cygdrive/c/Program Files (x86)/Skype/Phone:/cygdrive/c/Program Files (x86)/apache-maven-3.3.9/bin: C:/Program Files (x86)/Java/jre1.8.0_91:/cygdrive/c/texlive/2016/bin/win32:/cygdrive/c/Users/anyoung/AppData/Local/Box/Box Edit)
Error: JAVA_HOME is not defined correctly.
We cannot execute
在线搜索后,我发现我需要将Java安装路径添加到系统的PATH变量中。但是,我无法找到Java安装的路径:
$ whereis java
java:
$ which java
which: no java in (/jre/bin:/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/OpenSSH/bin:/cygdrive/c/Program Files (x86)/Symantec/VIP Access Client:/cygdrive/c/Program Files (x86)/Skype/Phone:/cygdrive/c/Program Files (x86)/apache-maven-3.3.9/bin: C:/Program Files (x86)/Java/jre1.8.0_91:/cygdrive/c/texlive/2016/bin/win32:/cygdrive/c/Users/anyoung/AppData/Local/Box/Box Edit)
我已经通过输入" Java"来验证安装了Java(版本8)。在我的搜索栏中。关于如何进行的任何想法?