Difference between Java and Java Commands

On windows, you might have noticed that, in task manager, we see either java.exe or javaw.exe, also in JAVA_HOME/bin we see these two java files java.exe and javaw.exe.

We see the difference between them. 

"java.exe" and "javaw.exe", both are Java executables on the Windows platform. They may be in the same versions of the Java Application Launcher utility.

javaw.exe is a non-console version of the application launcher is used for launching java applications in  GUIs applications.  These applications have windows with menus, buttons, and other interactive elements.  

We have to use javaw.exe when we don’t want a command prompt window to appear either to take further input or showing output.

java.exe  is very similar to javaw.exe. The console version of the launcher is used for applications with text-based interfaces or that output text. Any application launched with  "java" will cause the command-line to wait for the application response until it gets closed. then only it will take  next command

When launched using javaw, the application launches and the command line exits immediately and ready for the next command.

 javaw.exe is the command which will not wait for the application to complete. you can go ahead with other commands.

You can run your java program either by using java.exe or javaw.exe.

There might be error occurs while running the eclipse as,

javaw.exe cannot find the path

To resolve this issue we have to do steps:

update your eclipse.ini file (you can find it in the root-directory of eclipse) by this:

-vm path/javaw.exe

e.g  -vm C:/Program Files/Java/jdk1.8/jre/bin/javaw.exe.

Before make sure that you have installed java in windows.

If not here are the steps: create a PATH environment variable on your computer.

  • Right-click on My Computer/Computer.
  • Properties
  • Advanced system settings (or just Advanced).
  • Environment variables.

     
  • If the PATH variable doesn't exist in the "User variables" 
  • Click New (Variable name: PATH, Variable value : C:\Program Files\Java\jdk1.8.0\bin;//Please check out the right version, this may differ.
  • Open the command prompt and put a command like java -version to verify java installed or not. Click ok.we have done it!!!.

In this article, we have seen Difference Between java and javaw Commands and how to resolve issues javaw.exe cannot find the path.