In my Custom VM options in My IntelliJ, I have "-ea" in my idea64.exe.vmoptions. But why doesn't this report assertion error:
int a = 1;
int b = 2;
assert(a==b)
The idea64.exe.vmoptions
defines the java options which IntelliJ itself launches with; not what a given run configuration will launch with.
Once you've launched your program (via the little play icon next to your main
method), it should appear in the run configurations drop down at the top. If you go edit this, and add -ea
to the VM Options field, you can then run it with assertions enabled.
For Intellij 19.2 community version, I found the VM option to add -ea via going to top menu and following Run -> Edit Configurations... -> VM options:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With