Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javaw still creates a console window; Why is this? [duplicate]

My game engine's a combination of Jython and Java so I'm executing a jar along with a python script instead of a classfile.

java -jar Jython.jar init.py

However, when I change "java" to "javaw" it does not hide the console like it normally would. Why is this and is there a way to work around it?

like image 454
Luft Avatar asked Oct 22 '22 17:10

Luft


1 Answers

I don't think the JavaConsole is a function of java.exe vs javaw.exe. The difference is java.exe has stdout & stderr write to the SystemConsole and javaw.exe runs without stdout and stderr writting to the SystemConsole. Running java.exe will block because it is connected to the SystemConsole. Running javaw.exe will return control to the launching SystemConsole (or script) and continue to run without a SystemConsole.

Disable the JavaConsole using the java control panel or the java icon on the task bar.

from the java control panel

from the task bar java icon

like image 196
Java42 Avatar answered Oct 27 '22 16:10

Java42