[ 
https://issues.apache.org/jira/browse/NETBEANS-4073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17129993#comment-17129993
 ] 

Laird Nelson commented on NETBEANS-4073:
----------------------------------------

(Lurking on this issue.)

I am running NetBeans 12.0 on JDK 15 early access.

My Maven project includes the proper {{--enable-preview}} command line argument 
supplied to the {{maven-compiler-plugin}} in the proper way.  One thing worth 
noting is that I do this in {{<pluginManagement>}} in the parent pom of a 
multi-Maven-module project, not in {{<plugins>}}. I suspect perhaps someone did 
a naïve implementation of {{pom.xml}} parsing that did not account for this 
(legal) scenario.

{{nb-javac}} is uninstalled.

I experience the same issues as the original poster, so I think it's probably 
the same root cause, which is why I'm adding a comment here instead of creating 
a new issue.

> JDK14 features still declared as preview (e.g. switch) - Project contains 
> "file with errors"
> --------------------------------------------------------------------------------------------
>
>                 Key: NETBEANS-4073
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-4073
>             Project: NetBeans
>          Issue Type: Bug
>          Components: ide - Code, platform - JDK Problems
>    Affects Versions: 11.3
>         Environment: Manjaro Linux, JDK14, NB11.3
>            Reporter: Klaus Ahrenberg
>            Priority: Trivial
>              Labels: 11.3, jdk14, preview-features
>         Attachments: switch_expression.png
>
>
> 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");}}
>  {{}}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to