Differences between Java, javaw, and javaws:
First, all these are the startup configurations of Java. java.exeis often used. When the command line is output to Windows, the java.exe process is displayed. Generally, when we execute some small Java programs, the java.exe process is running. Javaw.exeis quite special for us. We can also see the running of the javaw.exe process through the task manager. Javaws generally processes when the web is enabled.
JVM. dll
JVM. dll is the implementation of a Java virtual machine on the Windows platform and is part of JRE. a c program can run directly on the JVM using JVM. dll.
Java.exe
Java.exe is a Win32 console application that provides help instead of JVM. DLL executes the Java classes file. As a Win32 console application, it is obviously associated with a console. When Java classes is executed, it runs.
Javaw.exe
Javaw.exeis unique and java.exe is a Win32 GUI application. The application provides its own GUI window and does not enable the console.
Therefore, you do not need to use the console to run a GUI program.
The following is an example:
package javaw;import javax.swing.*;public class HelloWorldSwing { private static void createAndShowGUI() { JFrame jFrame = new JFrame("HelloWorld Swing"); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel helloLabel = new JLabel("Hello World!"); jFrame.getContentPane().add(helloLabel); jFrame.pack(); jFrame.setVisible(true); } public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }}
The above is a GUI program, which runs on the console as follows:
Java-classpath. javaw. helloworldswing
Explanation:-classpath. indicates to set the classpath path to the current directory.
After running, check that the task manager has the java.exe process ------ because this is run on the console.
The figure is as follows:
If you run it directly in Eclipse: view the javaw.exe process in the task manager after running it-because it is not output through the console.
The figure is as follows:
If you use javaw to run it through the command line, it is also shown in:
Note: The Java w-classpath. javaw. helloworldswing startup process is javaw.exe.
Java-classpath. javaw. helloworldswing: java.exe
The difference between java.exe and javaw.exe is that after Java runs the GUI, it is blocked until the window is closed.
After running the GUI, Java W can directly run the next command.
Javaws.exe
The javaws.exe process is suitable for starting a program with Web configuration. In short, it is used in a web application.
Summary:
Java.exe is used to start the window console Program
Javaw.exe is used to start a GUI program.
Javaws.exe is used for web programs.
JVM. dll is an implementation of Java Virtual Machine specifications on Windows platforms.
Note: original address: http://javapapers.com/core-java/java-vs-javaw-vs-javaws/