5

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?

Zero Piraeus
  • 56,143
  • 27
  • 150
  • 160
Luft
  • 185
  • 4
  • 17
  • 4
    Just a guess: is your `java`/`javaw` command line in a batch file that is itself responsible for the console? – Mattie Feb 17 '13 at 02:58
  • Well it is running off a batch file, but that's my only method of executing the code, so if that's why it wont work then I'll just stick to it. – Luft Feb 17 '13 at 03:03
  • I just tested it off cmd instead of a batch file and the problem persists. Ideas? – Luft Feb 17 '13 at 03:05
  • Could you try creating a shortcut (I'm assuming you're running on Windows since you mentioned batch file) that executes javaw directly with the parameters needed to run your game engine? – Philip Tenn Feb 17 '13 at 03:06
  • I just attempted it and not only did it create a command window, but it also gave me an error that it couldn't access Jython.jar – Luft Feb 17 '13 at 03:13
  • is [this link](http://www.java.com/en/download/help/javaconsole.xml) helpful? – StarPinkER Feb 17 '13 at 04:33

1 Answers1

3

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

Java42
  • 7,628
  • 1
  • 32
  • 50