Trying to figure out how to add JDK 15 as a Java Platform for Netbeans.
Current Java version:
Folder Path:
JAVA_HOME in Environmental Values:
Adding JDK 15 to Netbeans:
Step 1)
Step 2)
Step 3)
Step 4)
Step 5)
Step 6)
Step 7)
After I have done this last step, my project classes are telling me this:
I have also edited the Netbeans config file:
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?
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:
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):
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:
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):
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:
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.