Could not find or load main class org.jetbrains.plugins.gradle.tooling.proxy.Main for projects in WSL Follow
I just wanted to migrate some of my existing projects to my WSL2 Ubuntu 18.04 distribution. After installing OpenJDK 11 with apt and moving a project from Windows to Ubuntu, I tried to open it with IntelliJ. I added the JDK to the configured SDKs and set it as Project SDK in the Project Structure, then configured Gradle to use the Project SDK, but something seems to be broken.
No matter whether I open a project or create an entirely new one directly in the WSL and set the SDK in the New Project dialog, the project initialization fails with the error "Could not find or load main class org.jetbrains.plugins.gradle.tooling.proxy.Main for projects in WSL". The log contains a "org.gradle.tooling.GradleConnectionException: Operation result has not been received."
Things I have tried so far:
- Invalidate caches
- Rollback to previous version
- Disabled the Android Plugin (https://youtrack.jetbrains.com/issue/IDEA-263810)
- Disable/Re-enable the bundled Gradle plugin
- Install Gradle in Ubuntu and set IntelliJ to use that
But nothing seems to work. Here is a clean idea.log containing everything from opening the IDE to opening the project and waiting until Gradle fails: Upload id: 2021_09_03_YEgDpg4DjmkBNCXY (file: idea.log)
Any help is greatly appreciated
Please sign in to leave a comment.
Please try to use Gradle wrapper.properties for the Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Gradle | Use Gradle from as a workaround. Does it help?
Yes, that actually worked, thank you!
One interesting thing I noticed was that after setting "Use Gradle from" and opening the settings again, the input field is cleared and IntelliJ warns me about Gradle not being set, but the build still works, so the workaround, while quirky, is at least stable. Thanks for helping!
Please follow https://youtrack.jetbrains.com/issue/IDEA-274118
Konstantin Annikov the link you provided is 404 https://intellij-support.jetbrains.com/hc/en-us/community/posts/4406120066194/comments/4406377121170
Shawn sorry, the submitter has restricted the visibility of the issue. This issue has been fixed in the latest IDE 2021.3.1 version.