Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build server error when running in WSL with JDK 8 #1628

Open
tudortimi opened this issue Nov 12, 2024 · 3 comments
Open

Build server error when running in WSL with JDK 8 #1628

tudortimi opened this issue Nov 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tudortimi
Copy link

Extension Name: vscode-gradle
Extension Version: v3.16.4
OS Version: Ubuntu 20.04.6 LTS in WSL
VSCode version: 1.95.2
JDK version: 8

Describe the bug

I'm getting the following error message when trying to run in VS Code with remote connection to WSL:

No connection to gradle server. Try restarting the server.

Opening the "Gradle for Java" output, I see:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/github/badsyntax/gradle/GradleServer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I'm using JDK 8, but the code seems to be compiled for JDK 15.

Strangely enough, even if I disable the build server in settings, I still get this error.

Expected behavior

The extension says it should work with Java version between 8 and 21.

Output from "Gradle for Java"

See the description.

Does the bug still exist if you disable all other extensions?
Yes

@tudortimi tudortimi added the bug Something isn't working label Nov 12, 2024
@jdneo
Copy link
Member

jdneo commented Nov 13, 2024

Could you share your vscode settings?

@tudortimi
Copy link
Author

For the Gradle extension, I'm using the defaults, in both Windows and in WSL:

Image
Image

@tudortimi
Copy link
Author

While looking at extensions, I noticed that the redhat.java extension wasn't installed in WSL, only in Windows. After installing it in WSL as well, the build server started working:

Image

It's using it's own JRE, though, which is at version 15. Is this expected? Also, it would have been nicer if VS Code would have told me explicitly that I also need the Java extension in WSL, because it's required by the Gradle extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants