[WSL 2] Compilation fails with JDK 1.8 ("Cannot find compatible JDK") but works with JDK 11 - Request for support or documentation clarification

已回答

Environment:

  • OS: Windows 11 with WSL 2 (Ubuntu)
  • IDE: IntelliJ IDEA  2025.3.1
  • Scenario: Opening and building a project located in WSL file system (\\wsl$\...)

Description: Hi JetBrains team and community,

I am encountering a frustrating issue when developing projects hosted in WSL 2 using IntelliJ IDEA on Windows.

I have installed both JDK 1.8 and JDK 11 inside my WSL environment.

  1. When I configure my project to use JDK 11 (detected from WSL), everything works perfectly (indexing, compilation, running).
  2. However, when I switch the project SDK to JDK 1.8 (also installed in WSL and detected by IDEA), the build fails with an error message similar to "Cannot find a compatible JDK" .

I have spent a significant amount of time troubleshooting this, checking environment variables (JAVA_HOME) and manual configurations, only to find that simply switching to JDK 11 "fixes" the issue. This suggests the environment setup is correct, but IDEA has trouble utilizing JDK 1.8 in the WSL context specifically for the build process.

My Request: Since many legacy enterprise projects still rely heavily on Java 8, could you please confirm:

  1. Is this a known limitation or a bug in the current WSL interop implementation?
  2. If JDK 1.8 is no longer fully supported for WSL-based development, could this be explicitly stated in the official documentation?

Lack of clear information on this compatibility led to hours of wasted time searching for a solution. I hope this can be addressed in future versions to support legacy projects or at least documented clearly to prevent other developers from falling into the same trap.

Thanks!

1
Hi,

Unfortunately you have hit a regression with WSL-based JDKs in IntelliJ IDEA 2025.3 and is tracked here: https://youtrack.jetbrains.com/issue/IJPL-222935

Regarding your second point: Java 8 is supported by IntelliJ IDEA please check: https://www.jetbrains.com/help/idea/supported-java-versions.html

One of the users found a workaround to restore IDE settings to defaults (although it does not work for everyone):
1. File > Manage IDE Settings > Restore Default Settings
2. Confirm Restore and Restart

Our team is actively working on a fix and you can track it by starring the ticket (top right).
0

I have the same problem,JDK8 is still widely used in the entrpise projects.

2

Same issue, we can not ignore the JDK8.

0

Hi Nghia Nguyen and Shannon Chen,
Thank you for your feedback. 

We have fixed the bug IJPL-222935.

Unfortunately, we are still working on resolving the issue specifically affecting builds with JDK 8 on WSL. You can track the progress in IDEA-371749 and IJPL-240092.

For now, you can use the workaround described in IDEA-371749.
Thank you for understanding!

0

Aleksandr Nagovitsyn Could you please let me know if there are any updates or new timelines for a fix?

Thanks a lot for your help!

0

Hi 13969774395,
I’m sorry that you’ve encountered this issue.

Unfortunately, I cannot provide an ETA for fixing it at the moment. You can subscribe to the tickets mentioned above in YouTrack to track updates and their resolution status.
See this article https://intellij-support.jetbrains.com/hc/en-us/articles/207241135 if you are not familiar with our bug tracking system.

Please use the workaround from IDEA-371749.

1

Hi Aleksandr Nagovitsyn  Thank you for your help with this issue.I would like to ask if using an older version of IntelliJ IDEA would allow me to run my project with JDK 8 without encountering this problem?

0
I've tried IDEA 2024.1.x to 2024.3.x, all no lucky. I suggest using this workaround instead: https://youtrack.jetbrains.com/articles/SUPPORT-A-847/How-to-install-and-run-IDEA-on-Windows-using-WSLG
0

Hi Aleksandr Nagovitsyn 

Do you have some news on this issue ?

What seems strange to me is the stacktrace visible in idea.log which suggest that the error is thrown because project is “remote” 
see https://github.com/JetBrains/intellij-community/blob/idea/2026.1.1/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java#L1238

2026-05-06 18:06:18,966 [ 383547]   INFO - #c.i.c.i.CompileDriver - java.lang.IllegalStateException: Failed to find compatible JDK
    at com.intellij.compiler.server.BuildManager.getIDERuntimeSdkOrErrorIfRemote(BuildManager.java:1238)
    at com.intellij.compiler.server.BuildManager.lambda$getBuildProcessRuntimeSdk$25(BuildManager.java:1160)
    at java.base/java.util.Optional.orElseGet(Optional.java:364)
    at com.intellij.compiler.server.BuildManager.lambda$getBuildProcessRuntimeSdk$26(BuildManager.java:1160)
    at com.intellij.compiler.server.BuildManager.lambda$getRuntimeSdk$38(BuildManager.java:1221)
    at java.base/java.util.Optional.orElseGet(Optional.java:364)
    at com.intellij.compiler.server.BuildManager.getRuntimeSdk(BuildManager.java:1221)
    at com.intellij.compiler.server.BuildManager.getBuildProcessRuntimeSdk(BuildManager.java:1149)
    at com.intellij.compiler.server.BuildManager.launchBuildProcess(BuildManager.java:1285)
    at com.intellij.compiler.server.BuildManager.lambda$scheduleBuild$17(BuildManager.java:1008)
    at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$submitTask$8(BackgroundTaskUtil.java:282)
    at com.intellij.openapi.progress.util.BackgroundTaskUtil.lambda$createBackgroundTask$10(BackgroundTaskUtil.java:318)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:283)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:744)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:819)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:775)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:743)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:267)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)

 

0

Hi Benoit Bertrand
There are no updates yet, unfortunately. 

Thank you for providing your feedback and the stacktrace from logs, I've passed it to the developers.
Please track updates about this problem in YouTrack issues:
https://youtrack.jetbrains.com/issue/IDEA-371749
https://youtrack.jetbrains.com/issue/IJPL-240092 

0

请先登录再写评论。