-
Notifications
You must be signed in to change notification settings - Fork 874
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
Use Project Dictated JVM for Gradle Discovery #4985
Use Project Dictated JVM for Gradle Discovery #4985
Conversation
extide/gradle/src/org/netbeans/modules/gradle/loaders/LegacyProjectLoader.java
Outdated
Show resolved
Hide resolved
My personal worst-case is developing for liferay-portal. It uses a custom patched gradle version and requires JDK 8 to build. This seems to improve the situation a lot! This is not yet a comprehensive test, but this is what I did: I build NetBeans from this branch. Additionally I had to adjust the gradle deamon settings like this ( org.gradle.jvmargs=-Xms512m -Xmx4g
liferay.home=/home/matthias/src/liferay-portal/bundles/ The first option give the gradle daemon enough space to handle the projects and the second is needed as the liferay build system sets this property from the ant invocation that starts the build. I have to restructure the build minimally, so that the grade wrapper is found. I build liferay once using Project loading takes time, but it feels nice to be able to open the projects in a sane manner. Thank you! |
As an update: I noticed, that I tested running on OpenJDK 11, but it also works on JDK 17 if I patch the diff --git a/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java b/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java
index c468f0737a1e..366b0574a8b1 100644
--- a/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java
+++ b/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java
@@ -532,7 +532,8 @@ public final class GradleDistributionManager {
* @return <code>true</code> if this version is supported with the runtime JDK.
*/
public boolean isCompatibleWithSystemJava() {
- return isCompatibleWithJava(JAVA_VERSION);
+ return true;
+// return isCompatibleWithJava(JAVA_VERSION);
}
/** |
Yes, that's a trivial patch for the first bulletpoint. It's on my radar, just got slammed with work in the last few weeks. |
Well, this form is a good enough implementation, without major changes. The The Java vs Gradle version mismatch problem only triggered, if the Project Java setting is off. I'm going to create a new update branch for NB16, where this and a few other fixes would go, as I think the Gradle support in base NB16 is not that great. |
Works for me. Build from this branch, ensured JDK 17 is active and was able to load liferay project after setting its JDK to 8. Thank you! |
Question: should be https://github.com/lkishalmi/netbeans/blob/gradle-use-project-java-for-discovery/extide/gradle/src/org/netbeans/modules/gradle/execute/GradleDaemonExecutor.java#L312 still a warning message ? (link corrected) |
I think the link is messed up. |
I think yes, it should be a Warning message. Though it is now displayed if the JVM set on project is not compatible with the Gradle in use. In that case the IDE would still try to use the "built-in" Gradle. It would be elegant to have a resolver for this problem. That's for a later time though... |
There would be more commits after this one. Need to iron out the following things: