javanetbeans-8netbeans-platformjava-15

Adding JDK 15 to Netbeans 8.2 RC


Trying to figure out how to add JDK 15 as a Java Platform for Netbeans.

Current Java version:

enter image description here

Folder Path:

enter image description here

JAVA_HOME in Environmental Values:

enter image description here

Adding JDK 15 to Netbeans:

Step 1)

enter image description here

Step 2)

enter image description here

Step 3)

enter image description here

Step 4)

enter image description here

Step 5)

enter image description here

Step 6)

enter image description here

Step 7)

enter image description here

After I have done this last step, my project classes are telling me this:

enter image description here

I have also edited the Netbeans config file:

enter image description here

enter image description here

But when I do this, Netbeans "breaks" in the sense that I cannot view the project files and a few other navigational issues that occur.

Am I doing something wrong? Am I missing something here?


Solution

  • Alright, I EVENTUALLY figured out the issue.

    I am not sure if in this will/should work for other Netbeans projects, however, this was required for the Maven project I am working with.

    There is a file called:

    nb-configuration.xml

    Which can be located here:

    enter image description here

    Side Note:

    This file is NOT generally visible in the tree structure above.

    I believe it appeared AFTER I assigned the other JDK to my project.

    When you open this file, it will look like this (provided you haven't edited it prior to this step):

    enter image description here

    As you can see, the file is empty.

    In this file, you need to specify the JDK to use, SPECIFICALLY if you've changed the JDK to be used by the project, as the steps below show:

    enter image description here

    IF you have NOT changed your JDK version for the project, then this nb-configuration.xml file will automatically point to the DEFAULT JDK.

    The code to add will look like this (Change to the JDK you want to use and make sure it matches the JDK selected for the project file):

    enter image description here

    Code:

    <netbeans.hint.jdkPlatform>JDK_15.0.1</netbeans.hint.jdkPlatform>
    

    NB!!!! Take NOTE:

    It's super IMPORTANTE to make sure you specify the EXACT JDK version as you have chosen for your project.

    You will see in the image above, that I have a commented out line that says:

    JDK_15

    and then I have the uncommented line

    JDK_15.0.1

    In my case, when I added JDK 15 to my project, I did NOT change the predetermined name in the Java Platforms section as seen below:

    enter image description here

    When I added the JDK, Netbeans named it as "JDK 15". This, however, is NOT what should be used for the editing of the nb-configuration.xml

    In my post, on one of the the screenshots, I asked why are the classes empty for the class path.

    According to this SO post, the NEW JDK's do NOT have individual JRE's and the classes are incorporated with the JDK itself.

    What JRE to use for JDK 14?