How to enable the Java keyword assert in Eclipse program-wise?

前端 未结 6 834
无人共我
无人共我 2020-11-27 05:44

How can I enable the assert keyword in Eclipse?

public class A
{
    public static void main(String ... args)
    {
        System.out.println(1         


        
6条回答
  •  感情败类
    2020-11-27 06:19

    If anyone wants to enable assertions by default (in contrast to enabling them for just a single run configuration), it is possible with the following steps:

    1. Window (menu bar)
    2. Preferences
    3. Java
    4. Installed JREs
    5. Select your JRE/JDK
    6. Press Edit...
    7. Default VM arguments
    8. Add -ea

提交回复
热议问题