Enable claims in the Java shell

C:\Users\Malvolio>jshell
|  Welcome to JShell -- Version 9.0.1
|  For an introduction type: /help intro

jshell> assert(false)

jshell> 

How can I get the Java shell to raise an AssertionError when the statement fails?

+4
source share
1 answer

Run it with the command:

jshell -R -ea

enter image description here

+3
source

Source: https://habr.com/ru/post/1690557/


All Articles