Open mambastudio opened 6 months ago
NetBeans 21 doesn't support running on JDK 22. Try this in NB22-rc4 and see if it's still an issue.
Just tried the NB22-rc4, and it's still showing me the same error!
But if I remove var, it works well.
Here is a screenshot of my netbeans...
Thanks for the report.
I'll take a look, but as a workaround, (assuming it is the Ant project), you should be able to go to File/Project Properties to tab Build/Compiling
, and unselect "Compile on Save".
Thanks for the report.
I'll take a look, but as a workaround, (assuming it is the Ant project), you should be able to go to File/Project Properties to tab
Build/Compiling
, and unselect "Compile on Save".
Thanks. Unselecting "Compile on Save" seems to work, and a good temporary solution.
Thanks. Unselecting "Compile on Save" seems to work, and a good temporary solution.
While a fix would be welcome, it would also be good to have "Compile on Save" off with Ant by default to bring in line with other build systems.
Apache NetBeans version
Apache NetBeans 21
What happened
Seems using var in pattern matching when implementing Algebraic Data Type patterns results "Exception in thread "main" java.lang.RuntimeException: Uncompilable code"
Language / Project Type / NetBeans Component
No response
How to reproduce
Seems using var in pattern matching when implementing Algebraic Data Type patterns results "Exception in thread "main" java.lang.RuntimeException: Uncompilable code"
For example, the code below throws the exception when run on netbeans
But if I change the SumExpr(var a, var b), to SumExpr(ConstExpr a, ConstExpr b) in the pattern matching in switch, the following code works
I'm running Netbeans 21, using JDK 22. There is no problem if I run the code in jdk 22 directly.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 10
JDK
22
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
No