Intellij run program : system can not find specified file [wsl2]

Answered

Hi, I'm pretty much new to java programming
I have installed IntelliJ 2020.3 ultimate edition for Java development on my windows 10
now I want to use it in my wsl2 (with ubuntu 20.4) environment
I have installed amazon Corretto 11 as a JDK with the default apt manager of Linux and also have defined the installation path for the IDE, and the IDE does the indexing without any problem
but when I make a new project and I make a new class in the src folder and make the main method and try to run the program I get the error:
Cannot run program "\\wsl$\Ubuntu-20.04\usr\lib\jvm\java-11-amazon-corretto\bin\java.exe" (in directory "C:\Users\sinas\AppData\Local\JetBrains\IntelliJIdea2020.3\compile-server"): CreateProcess error=2, The system cannot find the file specified
but when I try to compile the program with javac in my terminal (not with the built-in javac compiler ) the program compiles and runs without any problem

  • running java --version I get : 

and then when running the program I will get the error :

  • a list of my SDKs : 
0
1 comment

WSL2 support for java project has been released in 2021.1 (EAP build). See the post on this matter: https://blog.jetbrains.com/idea/2021/01/intellij-idea-2021-1-eap-1/

 

You can download EAP here: https://www.jetbrains.com/idea/nextversion/

 

1

Please sign in to leave a comment.