What is the difference in running an application (for example, Eclipse) with java.exe, javaw.exe and jvm.dll? Also, does it make any difference in terms of performance?
-
3Read Java Tools - http://docs.oracle.com/javase/1.5.0/docs/tooldocs/ – KV Prajapati Dec 14 '11 at 10:59
2 Answers
jvm.dll
is the actual Windows implementation of the JVM (or better, the main entry point). C or C++ applications can use this DLL to run an embedded Java runtime, and that would allow the application to interface directly with the JVM, e.g. if they want to use Java for its GUI.java.exe
is a wrapper around the DLL so that people can actually run Java classes without the need for a custom launcher application. It is a Win32 Console application, so Windows will open a fresh Command Prompt window if the exe is not run from a batch file.javaw.exe
is a wrapper likejava.exe
, but it is a Win32 GUI application. Windows doesn't have to open a Command Prompt window, which is exactly what you want to run a GUI application which opens its own windows.
EDIT: These shouldn't make any difference in performance except for the overhead of process creation and initialization.
The most important thing: it should't matter; if you are worrying about this you might actually want to keep Java running instead of launching it hundreds of times.

- 3,311
- 24
- 37
-
One question emerges. When I run a batch file, which contains `javaw -jar MyApp.jar` from Win7, the cmd window opens. Why? MyApp.jar opens JFrame instance. – MockerTim Dec 14 '11 at 11:32
-
1@MockerTim: `.bat` file opens the Windows prompt (console) eagerly, before `javaw.exe` even starts. – Tomasz Nurkiewicz Dec 14 '11 at 11:49
-
@TomaszNurkiewicz And is there any simple way to launch a long line with `javaw` from file without the opening of the cmd? – MockerTim Dec 14 '11 at 11:54
-
1@MockerTim: It takes a VB script or Windows Shortcut to run it without a Command Prompt window. You might want to start a new question though, as it actually has nothing to do with javaw like Tomasz pointed out. – JBert Dec 14 '11 at 12:16
java.exe
- run a Java program (need to specify classes and/or JARs) starting from specified class containingmain()
method.javaw.exe
- as above but does not create a Windows command prompt (suitable for Swing programs that do not need a console).jvm.dll
- this is not a runnable but a library. Probably used by both programs above.

- 334,321
- 69
- 703
- 674
-
-
1@ManishSharma: between the **two**, `jvm.dll` has nothing to do with it. There is **no performance difference** (except unnecessary command prompt created with `java.exe` if not needed). Use the one that better suits to your application (command-line vs. GUI app) – Tomasz Nurkiewicz Dec 14 '11 at 11:12