错误:JAVA_HOME设置为无效的目录,用于安装maven

时间:2015-06-24 18:57:04

标签: maven path java-home

我第一次尝试在我的机器win 7(64位)上安装Maven。我在设置路径环境系统变量时遇到问题。我收到错误JAVA_HOME设置为无效目录。 我已经尝试了各种方法,但是在流动的帖子中有所提及,但我没有得到解决方案。请帮我。[在这里输入图片说明] [1] 这里我的变量是

CLASS_PATH:C:\ Program Files \ Java \ jdk1.8.0_45 \ bin \ lib

JAVA_HOME:C:\ Program Files \ Java \ jdk1.8.0_45 \

M2:%M2_HOME%\ bin中

M2_HOME:C:\ Program Files \ apache-maven-3.3.3

MAVEN_HOME:C:\ Program Files \ apache-maven-3.3.3

路径:C:\ ProgramData \甲骨文\爪哇\ javapath;%SYSTEMROOT%\ SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT%\ System32下\ WBEM;%SYSTEMROOT%\ System32下\ WindowsPowerShell \ V1.0 \; C:\程序文件(x86)\ Skype \ Phone \; C:\ Program Files(x86)\ Java \ jdk1.8.0_45 \ bin; c:\ Program Files(x86)\ Microsoft SQL Server \ 100 \ Tools \ Binn \ VSShell \ Common7 \ IDE \; c:\ Program Files(x86)\ Microsoft SQL Server \ 100 \ Tools \ Binn \; c:\ Program Files \ Microsoft SQL Server \ 100 \ Tools \ Binn \; c:\ Program Files(x86) \ Microsoft SQL Server \ 100 \ DTS \ Binn \; c:\ Program Files \ Microsoft SQL Server \ 100 \ DTS \ Binn \; C:\ Program Files \ Microsoft SQL Server \ Client SDK \ ODBC \ 110 \ Tools \ Binn \ ; C:\ Program Files(x86)\ Microsoft SQL Server \ 120 \ Tools \ Binn \ ManagementStudio \; C:\ Program Files(x86)\ Microsoft SQL Server \ 120 \ Tools \ Binn \; C:\ Program Files \ Microsoft SQL Server \ 120 \ Tools \ Binn \; C:\ Program Files(x86)\ Microsoft SQL Server \ 120 \ DTS \ Binn \; C:\ Program Files \ Microsoft SQL Server \ 120 \ DTS \ Binn \; C:\ Program Files \ MongoDB \ Server \ 3.0 \ bin;%M2_HOME%\ bin;

1 个答案:

答案 0 :(得分:3)

1>在Enviroment变量设置屏幕中删除所有变量以设置maven 2 - ;您需要设置以下变量

JAVA_HOME = C:\Program Files\Java\jdk1.8.0_45
MAVEN_HOME = C:\Program Files\apache-maven-3.3.3    

3>在路径变量中点击编辑,然后设置以下代码

;%JAVA_HOME%\bin;%MAVEN_HOME%\bin