maven在Mule项目Java路径中将bin加倍
我正在运行当前设置:
- 操作系统:Win10
- Java:1.8采用OpenJDK(JDK+JRE)
- Mule:4.2.1/Anypoint Studio 7.9
- Maven:嵌入Studio-3.6.3
问题是:
Unable to execute Java command. The system cannot find the file specified. (0x2)
"C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.282.8-hotspot\\bin\\bin\\javaw.exe" -version
Failed to retrieve the version of Java. Resolving to the lowest supported version (1.4).
Launching a JVM...
Unable to execute Java command. The system cannot find the file specified. (0x2)
"C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.282.8-hotspot\\bin\\bin\\javaw.exe"
Win10环境:
C:\Users\1>echo %JAVA_HOME% - C:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot
C:\Users\1>echo %PATH% - C:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\bin;C:\apache-maven-3.8.1-bin\apache-maven-3.8.1\bin;
这是问题描述下面运行的Studio项目的提示:
Advice:
Usually when the Wrapper fails to start the JVM process, it is
because of a problem with the value of the configured Java command.
Currently:
wrapper.java.command=C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.282.8-hotspot\\bin\\bin\\javaw.exe
Please make sure that the PATH or any other referenced environment
variables are correctly defined for the current environment.
但除了系统环境变量,它什么也没告诉我,但它们看起来是正确的
我尝试过的:
- 检查环境变量(系统和用户)-一切正常,还与队友一起检查以确保
- AnyPointStudio检查:运行正确的(1.8)Java、Maven(3.6.3)和Mule(4.2.1)
- Maven和Studio配置文件-一切都正确(使用%JAVA\u HOME%)
我不知道这第二个“垃圾桶”是从哪里来的,谢谢你们的建议
# 1 楼答案
默认情况下,Anypoint Studio有其嵌入式版本的OpenJDK来执行Mule项目。您可以从Preferences / Java / Installed JREs中的UI中选择一个替代方案(同时用于JDK和JRE)。这种情况似乎是因为错误指的是安装在Studio外部的JDK。JDK.0要确保程序的home\JDK.8目录(而不是JDK.8)中的JDK-bin\Program:\JDK-adopted\Program\JDK.8的子目录中的JDK-adopt\8)是JDK-8。Studio将假定Java可执行文件位于JDK home的bin子目录下
# 2 楼答案
在this answer和this one中提到的混淆是什么
IDE似乎以更复杂的方式管理JDK,类似的步骤帮助我配置了我的想法