-
Notifications
You must be signed in to change notification settings - Fork 453
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
[doubt] Java 8, Java 11 and Gradle #1536
[doubt] Java 8, Java 11 and Gradle #1536
Comments
@qzmarco could you try to add
to your build.gradle. |
@snjeza I already have this line in my build grade. The thing is: Gradle Tasks is using the Java 11 JVM instead of Java 8 JVM and it causes a crash on the build process. |
@qzmarco could try the following VS Code settings:
|
@qzmarco could you attach your build.gradle and settings.json? |
I think we need to expose "java.import.gradle.java.home" - location to the JVM used to run the Gradle daemon (machine scoped, for security reason) |
@qzmarco you can try to set
to gradle.properties. It should work if you use gradle >= 4.7 |
vscode-java now exposes the |
Guys, this change has broken my workspace. Gradle isn't building older versions. I have configured the java.import.gradle.java.home to my JDK 8 path but it's not working. Also, the vscode-gradle extension is using the java.home JDK, and it is calling the JDK 11 instead JDK 8. |
@qzmarco which version of Gradle are you using? You might want to try the "Java : Clean the Java Language server workspace" command. |
I am using several Gradle versions, since 3.5.1 to 5.4. Now, I have updated one project to Gradle 4.10.2 and the vscode can't recoginize it has a Spring-Boot-Application. I don't know why, but something is trying to use a Gradle 6.3 version, that I don't use in my workspace. [Error - 2:26:06 PM] Jul 22, 2020, 2:26:06 PM An internal error occurred during: "Update project api-gateway-service". [Warn - 2:26:06 PM] Jul 22, 2020, 2:26:06 PM Synchronize project api-gateway-service failed due to an error connecting to the Gradle build. [Warn - 2:26:06 PM] Jul 22, 2020, 2:26:06 PM Synchronize Gradle projects with workspace failed due to an error connecting to the Gradle build. [Warn - 2:26:06 PM] Jul 22, 2020, 2:26:06 PM Synchronize project api-gateway-service failed due to an error connecting to the Gradle build. [Warn - 2:26:06 PM] Jul 22, 2020, 2:26:06 PM Synchronize project api-gateway-service failed due to an error connecting to the Gradle build. Also, I am running those projects under WSL2, so I am configuring the |
can you try killing all the Gradle Daemons and try again? |
@fbricon yeah, I have deleted all my daemons right now, but it hasn't worked |
can you share your java settings from vscode? |
|
do you have other gradle related settings there? |
Related issue - gradle/gradle#8285 |
@fbricon no, my settings.json, from WSL2, is this one. |
@qzmarco could you attach a project example or your build.gradle? |
|
@qzmarco I can't reproduce the issue. |
@snjeza could you please attach what was your settings.json? Are you using Gradle Wrapper at version 4.10.2? And are you using JDK 8? |
settings.json
I have tested gradle 6.3 and gradle 4.10.2.
The gradle daemon uses JDK8.
|
@snjeza thank you very much. I'll verify what is happening here and let you know guys, asap |
@qzmarco I suppose you have an error in your build.gradle file. Maybe, it is reproducible only with JDK 11. The tooling API run with JDK11. |
@snjeza I have updated my older Gradle versions to 4.10.2 and executed again each wrapper, to generate new wrapper files and its configs. Now everthing is doing fine. Thank you guys very much. |
Hi guys!
I have a question. I still need to use Java 8 and older Gradle versions on the company's code. I have noticed that, the Gradle Tasks on my vscode is using the Java configured at java.home (in my case, is the Java 11), but I need that Gradle Tasks uses the Java 8, that is configured at java.configuration.runtimes.
How can I change this? Is it possible? Is this a bug? I'm concerned about it, because the Java Extension is losing its support to Java 8 and I do need to use Java 8 in this moment.
Thank you.
The text was updated successfully, but these errors were encountered: