Reputation: 25
I am running current setup:
The issue is:
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 environments:
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;
That is a tip from Studio project run below the issue description:
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.
But it tells me nothing except system env vars but they look correct.
What I have tried:
I have no idea where is Studio taking this second "bin" from, thank you for all advices.
Upvotes: 1
Views: 460
Reputation: 25699
By default Anypoint Studio has its embedded version of OpenJDK to execute Mule projects. You can select an alternative one from the UI in Preferences / Java / Installed JREs (serves for both JDKs and JREs). It seems that this is the case because the error refers to a JDK installed outside Studio. Ensure that the location of the Java 8 SDKs configured point to the 'home' directory of the JDK (in your case it seems to be C:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot) rather than to the bin subdirectory (C:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\bin). Studio will assume the Java executable is under the bin subdirectory of the JDK home.
Upvotes: 1
Reputation: 26
What's about confuguration mentioned in this answer and this one?
Seems like IDEs manage JDK in more sophisticated ways, similar steps helped me to configure my IDEA
Upvotes: 1