Java – enable assertions at runtime in NetBeans

I tried assert example

It works normally in commandprompt I run the code with the following command

java -ea AssertionExample

However, in NetBeans, the runtime does not display the exception example description assertion, which will work when enabled at runtime, so we added EA

How do we enable assertions in NetBeans?

Solution

>Right click your project > Properties > Run > VM Options > Add - EA to box

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>