“오류 : 선택한 JDK에서 Java VM 실행 파일을 확인할 수 없습니다”의 이유는 무엇입니까?
IntelliJ IDEA 13.1.4를 사용하고 있으며 최신 릴리스 14도 사용해 보았습니다.
SBT를 실행하면 다음 오류가 발생합니다.
Error:Cannot determine Java VM executable in selected JDK
내 컴퓨터와 PATH에 JDK 1.7이 설치되어 있습니다.
로그 ( ~/Library/Logs/IntelliJIdea14/idea.logMacOS)에는 다음과 같은 스택 추적이 있습니다.
2014-11-03 11:22:05,054 [4896641] WARN - nal.AbstractExternalSystemTask - Cannot determine Java VM executable in selected JDK
com.intellij.openapi.externalSystem.model.ExternalSystemException: Cannot determine Java VM executable in selected JDK
at org.jetbrains.sbt.project.SbtExternalSystemManager$$anonfun$10.apply(SbtExternalSystemManager.scala:97)
at org.jetbrains.sbt.project.SbtExternalSystemManager$$anonfun$10.apply(SbtExternalSystemManager.scala:97)
at scala.Option.getOrElse(Option.scala:120)
at org.jetbrains.sbt.project.SbtExternalSystemManager$.executionSettingsFor(SbtExternalSystemManager.scala:96)
at org.jetbrains.sbt.project.SbtExternalSystemManager$$anonfun$getExecutionSettingsProvider$1.apply(SbtExternalSystemManager.scala:54)
at org.jetbrains.sbt.project.SbtExternalSystemManager$$anonfun$getExecutionSettingsProvider$1.apply(SbtExternalSystemManager.scala:54)
at org.jetbrains.sbt.package$$anon$3.fun(package.scala:29)
at org.jetbrains.sbt.package$$anon$3.fun(package.scala:28)
at com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil.getExecutionSettings(ExternalSystemApiUtil.java:590)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.a(ExternalSystemFacadeManager.java:201)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.a(ExternalSystemFacadeManager.java:178)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doInvoke(ExternalSystemFacadeManager.java:133)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager$MyHandler.invoke(ExternalSystemFacadeManager.java:270)
at com.sun.proxy.$Proxy57.getResolver(Unknown Source)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:475)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$1.run(ExternalSystemUtil.java:543)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:609)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$7.run(ProgressManagerImpl.java:410)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$3.run(ProgressManagerImpl.java:194)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:640)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:405)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)
그 이유는 무엇입니까?
프로젝트 열기 / 가져 오기 대화 상자가 아닌 설정에서 jdk를 설정하여 문제를 해결할 수 있어야합니다.
시작 화면 Configure -> Project defaults -> Project structure에서 jdk 로 이동하여 추가하십시오.

sbt 프로젝트를 열면 제대로 작동합니다.
JDK를 설정하는 또 다른 방법은 현재 모듈 / 프로젝트 설정 (현재 프로젝트)에서
선택 Open Module Settings(또는 기본 F4 히트) 프로젝트의 컨텍스트 메뉴에서
다음 왼쪽 탭을 선택 Project하고 포인트 올바른 Project SDK드롭 다운에.

이 문제는 일반적으로 ".idea / sbt.xml"의 잘못된 JDK 버전으로 인해 발생합니다. 예 :
<option name="jdk" value="1.7" />
이 옵션은 Project SDK가 변경 될 때 적절하게 업데이트되지 않습니다 ( SCL-10085 참조) . 다른 JDK (이 예제에서는 1.7)가 일반적으로 구성되어 있으면 오류가 발생하지 않지만 Project SDK는 자동으로 다시 변경됩니다. 그렇지 않으면이 오류가 발생합니다.
".idea / sbt.xml"의 값을 올바른 JDK 버전으로 수동으로 편집하면 문제를 쉽게 해결할 수 있습니다.
"SBT 작업"에서 새로 고침을 시도 할 때도 동일한 오류가 발생합니다.
열다
Preferences -> Language & Frameworks -> Scala Compiler Server
켜다
Run compile server (in external build mode)
Once you done with refreshing the project, turn it off again to enable hotswapping back when you change your code in the editor.
I had to open Settings -> Language & Frameworks -> Scala Compiler Server
Then set the JVM SDK there, which was <No SDK>.
This was in addition to setting the Project SDK in Project Structure -> Project.
See the screenshot here.
IntelliJ 13.1.6 > File > Project Structure > set Project SDK
I got the same problem after I delete Java1.6 and Java1.7 from Project Settings(with Java8 as default).
Finally I solve the problem by change SBT JVM config to Custom Java(Settings -> Build, Execution, Deployment -> Build Tools -> SBT).
For me the above suggestions did not help for some reason. However, I did figure out that under Project Defaults > Project Structure (Welcome screen) my default Project SDK was set to the Go SDK.
What worked for me was setting this default SDK to the Java JDK.
For me, I had selected the JDK in "Open Module Settings" > Module > Dependencies > Module SDK. However, SBT was looking for JDK at project level which is set in "Open Module Settings" > Project > Project SDK as @michasm has pointed out above
The latest Nightlies of the Scala plugin change how the project JDK is set, which should solve this in most cases. Let me know if it still breaks on some cases.
이것은 주 모듈의 Project SDK가 Python이고 JDK (sbt 프로젝트 가져 오기) 인 보조 모듈을 추가하려고 할 때 다국어 프로젝트에서 나에게 발생했습니다.
sbt 모듈을 추가하기 위해 기본 모듈의 Project SDK를 JDK로 일시적으로 전환해야했습니다. 그런 다음 돌아가서 각 모듈을 올바른 SDK로 변경할 수 있습니다.
참고 : https://stackoverflow.com/questions/25201365/whats-the-reason-for-errorcannot-determine-java-vm- executable-in-selected-jdk
'programing tip' 카테고리의 다른 글
| Sublime Text 3 테마가 사이드 바에 영향을 미치지 않는 이유는 무엇입니까? (0) | 2020.07.30 |
|---|---|
| “System.IO.Compression”네임 스페이스에서“ZipFile”클래스를 찾지 못했습니다 (0) | 2020.07.30 |
| Git으로 두 날짜 사이에 발생한 모든 커밋 사이의 차이점을 어떻게 알 수 있습니까? (0) | 2020.07.30 |
| 안전하지 않은 JavaScript가 URL로 프레임에 액세스하려고합니다. (0) | 2020.07.29 |
| ipython 내에서 Python 스크립트 실행 (0) | 2020.07.29 |