在IntelliJ IDEA中添加-ea等编译器选项的位置? [英] Where to add compiler options like -ea in IntelliJ IDEA?

查看:1016
本文介绍了在IntelliJ IDEA中添加-ea等编译器选项的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加 -ea 选项。我在项目设置中设置了 - > 编译器 - > Java编译器其他命令行参数

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

但它导致了一个make错误: invalid flag:-ea
P.S。:上述错误信息可能与您的错误信息不同,因为IntelliJ显示的是我母语的错误,而不是英语。我把它翻译成英文。

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.

推荐答案

启用 -ea 选项断言传递给JVM而不是编译器。将其添加为运行时配置的VM选项。

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.

菜单中的特定位置:运行>编辑配置...>配置> VM选项

这篇关于在IntelliJ IDEA中添加-ea等编译器选项的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆