Details
-
Improvement
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
12.0
-
None
-
None
Description
Since JDK9 there is -release flag which can specify which JDK API one wishes to compile against. Time to use it in NetBeans!
Historically NetBeans Java support tries to detect a JDK one is running on and decrease the requested -source level to the supported JDK. This is very annoying and in the context of -release flag, unnecessary.
Modern javac compiler have snapshot JDK API for each version since JDK7 to the latest JDK. Regardless on which version the NetBeans IDE is running, people should be able to select the right release/target JDK and get errors according to its API.
By default a specified -source (by a SourceVersionQuery) should also imply appropriate -release. There might be other means how to control both source as well as release.