gpt4 book ai didi

java - Maven 和 Java_Home

转载 作者:行者123 更新时间:2023-12-02 10:59:20 25 4
gpt4 key购买 nike

我正在使用 Netbeans 7.4。我下载了 Maven3.1 并解压到 C:\Apache\apache-maven-3.1.1 中。系统变量设置为:

JAVA_HOME is set at C:\Program Files\Java\jdk1.7.0_45 M2_HOME is set to C:\Apache\apache-maven-3.1.1

Path is set to C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Java\jdk1.7.0_45\bin;%M2_HOME%\bin

现在,当我从命令行输入 ..>mvn -v 时,我收到此错误:

ERROR: JAVA_HOME is set to an invalid directory. JAVA_HOME = "C:\Program Files\Java\jdk1.7.0_45;" Please set the JAVA_HOME variable in your environment to match the location of your Java installation

最佳答案

实际上你需要创建

<小时/>
system variable like this:
JAVA_HOME = C:\Program Files\Java\jdk1.7.0_45
CLASS_PATH = C:\Program Files\Java\jdk1.7.0_45\bin\lib
<小时/>
User variable
ME = C:\Program Files\apache-maven-3.1.1\bin
M2_HOME = C:\Program Files\apache-maven-3.1.1
MAVEN_OPTS = -Xms256m -Xmx512m
<小时/>
Path - insert into your path
C:\Program Files\apache-maven-3.1.1\bin
<小时/>

不要忘记重新启动系统

关于java - Maven 和 Java_Home,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20735093/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com