Rectangle 27 0

The javaw vs java application launcher

A couple of things to note here, concerning the two different issues in the problem:

From the Microsoft Windows XP knowledge base:

Run keys cause programs to automatically run each time that a user logs on. The Windows XP registry includes the following four Run keys:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce

Each of these keys has a series of values. The values allow multiple entries to exist without overwriting one another. The data value for a value is a command line.

Note the emphasis on the last line. The moment quotes are used, the command is bound to fail execution in the same manner it fails as if executed from a command prompt.

Also, note that the above approach is for Windows XP and does hold good for Windows 7. More details can be found in this Microsoft Technet article on the options available in Windows 7.

Once the java process can be initialized at Windows startup, one will get a console window that continues to stay around until the process is terminated. This occurs if the java executable is utilized to initialize the application.

The javaw command is identical to java, except that with javaw there is no associated console window. Use javaw when you don't want a command prompt window to appear. The javaw launcher will, however, display a dialog box with error information if a launch fails for some reason.

Therefore, if you wish to avoid opening a console window for the Java process, you ought to use the javaw executable.

jar - Windows Registery: How to add a Java app to startup list? - Stac...

java jar startup registry