What happens to “System.out.println()” in executable jar?

后端 未结 3 1036
刺人心
刺人心 2020-12-11 15:17

Suppose I\'ve created an executable jar from a code where I have used

System.out.println()

When we run the executable jar, th

3条回答
  •  粉色の甜心
    2020-12-11 15:47

    The output is omitted, as long as you do not run your application from a console window (java -jar executable.jar). Furthermore, you can configure your Java installation such, that a console windows is launched as soon as you start a Java application. Output will be written to the JVM's console window then. You can find an article How do I enable and view the Java Console? on the official Java web site.

    Activate Java console

提交回复
热议问题