netbeans-gradle-project icon indicating copy to clipboard operation
netbeans-gradle-project copied to clipboard

Gradle / netbeans debug session Not using Correct JDK sources

Open aplatypus opened this issue 7 years ago • 1 comments

Our Gradle build has

sourceCompatibility = '1.8' targetCompatibility = '1.8'

And the normal debug session loads/runs the current Java 8 JVM. However the Java Library source files are Always relate to the latest JAVA 7 JDK sources. This is not helpful when the actual runtime is Java 8.

On a related configuration. Setting the same project with sourceCompatibility = '1.7' targetCompatibility = '1.7'

Still runs Java 8 runtime and still uses the Java 7 JDK sources; which is still a problme since the rt.jar in use will (naturally) be the Java 8 runtime.

This makes tracking any code that needs to enter libraries almost impossible.

How do we specify the following in the gradle project?

  1. Java sources to use ?
  2. The actual Java run-time to use during test, run and debug tasks?
  3. How to reset these settings?
    • Since apparently the Java 7 sources are being loaded from some kind of "remembered" setting or something (one speculates).

aplatypus avatar Nov 09 '17 05:11 aplatypus

A related comment. On the Project Properties page -- the "Source Level" and "Target Platform" do Not match either/both the:

  • Current "Platform preference" setting
  • Project's build.gradle: targetCompatibility and sourceCompatibility settings.

In fact, after several attempts to change the "Platform preference" from the "Project Properties" panel; I've concluded that panel is Not Working as I'd expect it to. If the "Platform preference" allows me to make changes and is not greyed-out, it ought to update the settings.

aplatypus avatar Nov 09 '17 05:11 aplatypus