You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gradle Project Can't Regconise and Change Java Source/Binary Level #5958
Hi @lkishalmi,
I did further test/investigation and found that it is NOT a bug of Gradle plugin actually, it possible caused by my NetBeans workspace has corrupted (I always use the same workspace for any release of NetBeans, I upgrade NetBeans where there is a new release and share the workspace). When I delete the Gradle project that has compilation errors in NetBeans IDE (not in Gradle build console), open the project again, and the compilation error (that caused by source level) disappeared.
When I copy my project (that has problem) to a different folder, try to upload as an example project to this JIRA, I found it can be opened without any issue. So I found it's a corrupted workspace issue.
This issue can be closed.
However, the source/binary target level in Gradle project properties is ALWAYS 1.5 and can't be changed, it will be great if it can set to the correct value (from Gradle build file build.gradle) and can be changed in NetBeans' project configuration.
However, the source/binary target level in Gradle project properties is ALWAYS 1.5 and can't be changed, it will be great if it can set to the correct value (from Gradle build file build.gradle) and can be changed in NetBeans' project configuration.
Well, that's strange. I think there is some edge case in your project. You might get the project attached or just build NetBeans yourself and debug the following function:
I used a new workspace and tested, a brand new Gradle project created works (source/binary Java level reads from build.gradle correctly) but open an existing (legacy) Gradle project doesn't work - source/binary level sets to 1.8 but Netbeans reads it as 1.5.
Activity
lkishalmi commentedon May 19, 2023
I cannot reproduce this one. Using NetBeans 18-rc3.
lkishalmi commentedon May 19, 2023
Additional info. Sample project would be nice!
wayne-zhang commentedon May 29, 2023
Hi @lkishalmi,
I did further test/investigation and found that it is NOT a bug of Gradle plugin actually, it possible caused by my NetBeans workspace has corrupted (I always use the same workspace for any release of NetBeans, I upgrade NetBeans where there is a new release and share the workspace). When I delete the Gradle project that has compilation errors in NetBeans IDE (not in Gradle build console), open the project again, and the compilation error (that caused by source level) disappeared.
When I copy my project (that has problem) to a different folder, try to upload as an example project to this JIRA, I found it can be opened without any issue. So I found it's a corrupted workspace issue.
This issue can be closed.
However, the source/binary target level in Gradle project properties is ALWAYS 1.5 and can't be changed, it will be great if it can set to the correct value (from Gradle build file build.gradle) and can be changed in NetBeans' project configuration.
lkishalmi commentedon May 29, 2023
Well, that's strange. I think there is some edge case in your project. You might get the project attached or just build NetBeans yourself and debug the following function:
netbeans/java/gradle.java/src/org/netbeans/modules/gradle/java/api/GradleJavaSourceSet.java
Line 180 in 711207c
wayne-zhang commentedon May 29, 2023
I used a new workspace and tested, a brand new Gradle project created works (source/binary Java level reads from build.gradle correctly) but open an existing (legacy) Gradle project doesn't work - source/binary level sets to 1.8 but Netbeans reads it as 1.5.
BigFraction.zip