Unable to run maven in intellij terminal

已回答

I installed IntelliJ recently and imported a project from Git. I am able to execute maven  tasks using the vertical maven tab at the extreme right of the IDE. But if i try running mvn -version or mvn -install i get the message saying :

"The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE"

I have JAVA_HOME defined(H:\jdk\11x64-latest\bin), that is why intellij and another ide i have is working. I am using lastest version and it doesnot have a separate JRE.  So line 3 in the message is ruled out.  Please advise

Please advise.

 

0

H:\jdk\11x64-latest\bin is not a valid JAVA_HOME. JAVA_HOME points to the JDK installation location without bin subdirectory.

IntelliJ IDEA works without JAVA_HOME just fine, it doesn't use it.

0

请先登录再写评论。