Details
-
Bug
-
Status: Closed
-
Trivial
-
Resolution: Resolved
-
11.3
-
Manjaro Linux, JDK14, NB11.3
-
Patch
Description
With configuration NB11.2 and JDK13 I used the flag --enable-preview to use the new switch command for example. In JDK14 the new switch command is not longer a preview feature, it's implemented in the JDK now.
However, in NB11.3 and JDK14 I cannot use the --enable-preview flag. Running/compiling with this flag results in error. If I remove the flag, application is compiling and running in JDK14.
The Netbeans IDE itself shows in the project still "files with errors" and at every program run it displays the message "project still has failures. Continue?". If I look at the marked files with error, it shows me the files where the new switch command is used. The hint is "Use --enable-preview flag" which can not be used anymore.
To reproduce:
- Create Java App - Source level and JDK version 14
- Use new switch statement in code
switch (b) {
case 1 -> System.out.println("1");
default -> System.out.println("other");
}