简体   繁体   中英

Maven can't locate JAVA_HOME

I installed maven and added it to the path in my user variable but when i ran maven -v command from my command prompt, it showed that "maven is not recognized as an internal or external command ... ". When i run SET JAVA_HOME command it shows that the path to my jdk is okay. Before installing maven i deleted my old jdk 1.8.0 and installed jdk 1.8.0_201, whenever i start my netbeans IDE now it brings up a dialog box showing "Cannot locate java installation in the specified jdkhome: C\\Program Files\\Java\\jdk 1.8.0 Do you want to try to use default version?" When i click yes, my netbeans IDE works perfectly. I think the issue with the maven and jdk are related, i am using windows 8.1 OS. Can anyone please tell me how to get maven working? Thanks for your help in advance.

You call Maven with mvn . If calling mvn -v does not work, mvn is probably not on your path. Make sure that the bin directory in your Maven installation is on your Windows PATH.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM