I noticed that any call to System.out.println()
from a JAR file that hasn't been started by the command line (i.e. a Runnable JAR file started by user with double-click) won't open the console.
After doing some research, I found multiple answers on the site:
-
There is no problem doing like that. But where do you expect to see the output?
What happens to “System.out.println()” in executable jar?
If you run the code in some way that doesn't attach a console - such as
javaw
on Windows, which is the default program associated with executable jar files - then the output won't go anywhere. It won't cause any errors - the text will just be lost.
From what I understand, System.out
does not represent the console. It does represent data which can be handled by anything that needs to display it.
Am I right?
- What is
System.out
exactly? - How do I open the console from a Runnable JAR file started by user with double-click?