mbien commented on issue #7702: URL: https://github.com/apache/netbeans/issues/7702#issuecomment-2314304455
A NetBeans release can only support the latest preview (in case it wasn't released yet) or the final version of a language feature. Which means you would have to use the final version of JDK 21+ (https://openjdk.org/projects/jdk/21/). javac itself does only support the latest version, so your code snippet will not compile on JDK 21 for example. Since the java editor is using a current snapshot of javac at the time of release, it does also only have access to one implementation at a time. (pattern matching in switch had 4 previews + release) options: - update your project to JDK 21+ - try using NB 17 which shipped with nb-javac based on javac 19 if my notes are correct. It looks like preview 3 supported the syntax you are using still. Preview 4 changed it, but I didn't look at it in detail. - don't use preview features, unless you are willing to keep upgrading to the latest jdk / take the risk of having to make changes related: https://github.com/apache/netbeans/discussions/7620 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
