I am wondering, what's the difference between java
/javaw
/javaws
? I found under windows, most of Java is started using javaw
.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I have checked that the output redirection works with javaw:
It means, if the java application prints out anything via System.out or System.err, it is written in that files, as also with using java (without w). Especially on starting java the JRE may write starting errors (class not found) on the error output pipe. In this respect it is essential to know about errors. I suggest to use the console redirection in any case if javaw is invoked.
In opposite if you use
With the windows console start command, the console output redirection does NOT work with java and with javaw too.
Explaination, why it is so: I think that javaw opens an internal process on the OS (adequate using the java.lang.Process class), and transfers a known output redirection to this process. If no redirection is given on command line, nothing is redirect and the internal started process for javaw has no console outputs. The behavior for java.lang.Process is similar. The virtual machine may use this internal feauture for javaw too.
If you use 'start', the windows console creates a new process for windows to execute the command after start, but this mechanism does not use a given redirection for the started sub process, unfortunately.
See docs for:
java
command1/javaw
command2javaws
command, the "Java Web Start command"See also JDK 9 Release Notes Deprecated APIs, Features, and Options:
from http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=%2Fcom.ibm.java.doc.user.aix32.60%2Fuser%2Fjava.html:
And javaws is for java web start applications, applets or something like that i would suspect
java.exe is associated with the console, whereas javaw.exe doesn't have any such association. So, when java.exe is run, it automatically opens a command prompt window where output and error streams are shown.
java: java application executor which is associated with a console to display output/errors
javaw: (java windowed) application executor not associated with console. So no display of output/errors. Can be used to silently push the output/errors to text files. Mostly used to launch GUI based application
javaws: (java web start) to download and run the distributed web applications. again No console is associated.
All are part of JRE and use same JVM