Option to change the default java version. #5488
Replies: 4 comments 5 replies
-
the default java platform is currently the same as the JDK NetBeans is running on. This makes sense if you think about it because this is the only JDK installation NB knows for sure that it exists. It would be nice to be able to change this in the UI, but it is also somewhat risky, it can be changed in the config file though. If the path is set wrong and NB doesn't start the user knows at least already where to fix it :) there are also community bundles available which often ship with a very recent JDK all in one package, they are listed on the download page under the main downloads - this problem doesn't appear there either since the default JDK would be the most recent one already. |
Beta Was this translation helpful? Give feedback.
-
Why don't you treat them as 2 different properties? There's the JDK that NB uses to run, and there is the one NB uses to compile. NB can always be linked to the one it need to run, and changing the default JDK version would only apply to the JDK used when opening and compiling projects. |
Beta Was this translation helpful? Give feedback.
-
Yes, you are correct, but when opening an existing Gradle project for the first time, I am constantly getting an annoying error message saying the project can't be loaded. I have to do 2 things. First, I set the project JDK version from Java 17 to Java 11. Then I perform a first build on the project. These 2 things fix the issues, and the project loads without any problems. It's just annoying to have to do this every time I open a new project. I am pushing the envelop at my company by using Java 11, but this project I am working on doesn't interface directly with the current project so I can get away with not using Java 8. |
Beta Was this translation helpful? Give feedback.
-
I can definitely see the use for this. I use project groups a lot, and being able to set this based on active project groups would be really useful. I had not realised that project groups have an API for additional properties. You can set up a custom Maven home for a project group (learn something new every day!). Being able to configure a Java platform for all projects in a group, across build system, would be really useful. |
Beta Was this translation helpful? Give feedback.
-
It would be great if you could change the default version. My Linux system uses a default version of OpenJDK 11. NetBeans 16 has the java version set to 17. Every time I open a project for the first time, it throws an error. The Gradle version I am using is 6.8.2 which doesn't support 17. Once I set the version of the JDK to 11, it is fine. I actually don't use 17 at all.
Beta Was this translation helpful? Give feedback.
All reactions