天天看点

解决maven报错JAVA_HOME should point to a JDK not a JRE问题

在idea terminal界面输入 mvn compile 对项目编译时报错:JAVA_HOME should point to a JDK not a JRE

解决:在mavem目录bin目录下找到mvn.cmd文件使用记事本打开,在文件第一行输入set JAVA_HOME=D:\Java\jdk1.8.0_101(此处为你的Jdk所在)

解决maven报错JAVA_HOME should point to a JDK not a JRE问题
解决maven报错JAVA_HOME should point to a JDK not a JRE问题

"C:\Program Files\Java\jdk1.8.0_131\bin\java" -Dmaven.multiModuleProjectDirectory=F:\app\mbu -Dmaven.home=E:\dev\maven\apache-maven-3.5.2 -Dclassworlds.conf=E:\dev\maven\apache-maven-3.5.2\bin\m2.conf "-javaagent:E:\dev\IntelliJ IDEA 2017.3.4\lib\idea_rt.jar=10052:E:\dev\IntelliJ IDEA 2017.3.4\bin" -Dfile.encoding=UTF-8 -classpath E:\dev\maven\apache-maven-3.5.2\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.3.4 -s E:\dev\maven\apache-maven-3.5.2\conf\settings.xml -Dmaven.repo.local=E:\dev\maven\repository_boot test

[INFO] Scanning for projects...

[WARNING]

[WARNING] Some problems were encountered while building the effective model for com.murong.ecp.app:mbu:jar:1.0.1-SNAPSHOT

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:commons-codec:jar -> duplicate declaration of version 1.6 @ line 950, column 21

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:commons-codec:jar -> duplicate declaration of version 1.6 @ line 956, column 21

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:commons-logging:jar -> duplicate declaration of version 1.1 @ line 1028, column 21

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:neethi:jar -> duplicate declaration of version 3.0.3 @ line 1323, column 21

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:slf4j-api:jar -> duplicate declaration of version 1.7.7 @ line 1390, column 21

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:wsdl4j:jar -> duplicate declaration of version 1.5.1 @ line 1518, column 21

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:xmlschema-core:jar -> duplicate declaration of version 2.2.1 @ line 1536, column 21

[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: thirdparty:junit:jar -> duplicate declaration of version 4.12 @ line 2184, column 21

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 2366, column 21

[WARNING]

[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

[WARNING]

[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

[WARNING]

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] Building mbu 1.0.1-SNAPSHOT

[INFO] ------------------------------------------------------------------------

[WARNING] The POM for thirdparty:fastjson:jar:1.2.76 is missing, no dependency information available

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 2.699 s

[INFO] Finished at: 2021-06-15T17:47:08+08:00

[INFO] Final Memory: 8M/155M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project mbu: Could not resolve dependencies for project com.murong.ecp.app:mbu:jar:1.0.1-SNAPSHOT: Failure to find thirdparty:fastjson:jar:1.2.76 in http://192.168.139.188:8081/repository/ecp-releases/ was cached in the local repository, resolution will not be reattempted until the update interval of ecp-releases has elapsed or updates are forced -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Process finished with exit code 1