Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
552 views
in Technique[技术] by (71.8m points)

java - Where to add compiler options like -ea in IntelliJ IDEA?

I want to add the -ea option. I set it in Project Settings --> Compiler --> Java Compiler : Additional command line parameters.

But it caused a make error: invalid flag: -ea. P.S.: the above error message may not be the same as yours, because IntelliJ showed error in my native language, not English. I translated it into English.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The -ea option to enable assertions is passed to the JVM not to the compiler. Add it as a VM option for your runtime configuration.

Specific location in the menu: Run > Edit Configurations... > Configuration > VM options:

Where to put the <code>-ea</code> flag


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...