Related to Find absolute java.exe path programatically from java code is there any way to know if the java process you're running was started as "java.exe" vs. "javaw.exe"?
Thanks
java.exe is the command where it waits for application to complete untill it takes the next command. javaw.exe is the command which will not wait for the application to complete. you can go ahead with another commands.
The javaw command is identical to java, except that javaw has no associated console window. Use javaw when you do not want a command prompt window to be displayed. The javaw launcher displays a window with error information if it fails.
This non-console version of the application launcher is used to launch java applications usually with graphical user interfaces (GUIs). These applications have windows with menus, buttons and other interactive elements.
javaw.exe is a legitimate file from Sun Microsystems. It is an executable file used for displaying error messages, if they occur while installing any application. It's an essential Java file and it is typically located in c:\program by default.
If the VM has no Console available (say, because you started it with javaw.exe), then a call to System.console()
will return null.
edit: i.e.,
final boolean amRunningJavaW = System.console() == null;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With