HowToDoInJava

  • Python
  • Java
  • Spring Boot
  • Dark Mode
Home / Java / Java Basics / Difference between java.exe and javaw.exe

Difference between java.exe and javaw.exe

“java.exe” and “javaw.exe”, both are Java executables on the Windows platform. These files are nearly identical versions of the Java Application Launcher utility. Both versions of the launcher take the same arguments and options. The launcher is invoked with “java” or “javaw” followed by launcher options, the class or Java archive (JAR) file name and application arguments.

javaw.exe

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. Essentially, Use javaw.exe when you don’t want a command prompt window to appear either to take further input or showing output.

The javaw.exe launcher will, however, display a dialog box with error information if a launch of java application fails for some reason.

java.exe

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 waits for the application response till it closes.

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

That’s only noticeable difference between java.exe and javaw.exe. If you know any other noticeable differences, please share wit all of us.

Happy Learning !!

Was this post helpful?

Let us know if you liked the post. That’s the only way we can improve.

Share this:

  • Twitter
  • Facebook
  • LinkedIn
  • Reddit

About Lokesh Gupta

A family guy with fun loving nature. Love computers, programming and solving everyday problems. Find me on Facebook and Twitter.

Feedback, Discussion and Comments

  1. D. Sullivan

    July 8, 2020

    Can I eliminate either java or javaw on my computer. Or do I need both of them? Thank you

    • Lokesh Gupta

      July 8, 2020

      Yes, you need both. IDEs use javaw.exe.

  2. MMK

    July 13, 2016

    import javax.swing.JFrame;
    public class Hi{
    	int someNumber;
    	public static void main(String args[]){
    		JFrame jf = new JFrame("Hi");
    		jf.setVisible(true);
    		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		System.out.println("Hi");
    	}
    }
    

    Run this code with java.exe and javaw.exe to see the difference.

    • Madan

      September 3, 2019

      Thanks it was really a good example for beginners.

  3. Saro

    May 24, 2016

    Could you please add an example, for better understanding… of how to launch with java.exe and javaw.exe

    • Lokesh Gupta

      May 24, 2016

      Use command prompt, please. Nothing complex here.

  4. Ramesh

    June 18, 2014

    good articles

Comments are closed on this article!

Search Tutorials

Java Basics

  • Java Introduction
  • Java Installation
  • Java Hello World
  • Java JDK, JRE and JVM
  • Java Classes and Objects
  • Java ClassPath
  • Java Operators
  • Java Data Types
  • Java Primitive Types
  • Java Variables
  • Java Comments
  • Java main() Method
  • Java Command Line Args
  • Java Wrapper Classes
  • Java Types of Statements
  • Java Block Statement
  • Java Pass-by-Value
  • Java System Properties
  • Java Static Import
  • Java hashCode() and equals()
  • Java Immutable Class
  • Java 32-bit vs 64-bit
  • Java java.exe vs javaw.exe
  • Java Generate Bytecode
  • Java Naming Conventions
  • Java Little-Endian vs Big-Endian

Java Tutorial

  • Java Introduction
  • Java Keywords
  • Java Flow Control
  • Java OOP
  • Java Inner Class
  • Java String
  • Java Enum
  • Java Collections
  • Java ArrayList
  • Java HashMap
  • Java Array
  • Java Sort
  • Java Clone
  • Java Date Time
  • Java Concurrency
  • Java Generics
  • Java Serialization
  • Java Input Output
  • Java New I/O
  • Java Exceptions
  • Java Annotations
  • Java Reflection
  • Java Garbage collection
  • Java JDBC
  • Java Security
  • Java Regex
  • Java Servlets
  • Java XML
  • Java Puzzles
  • Java Examples
  • Java Libraries
  • Java Resources
  • Java 14
  • Java 12
  • Java 11
  • Java 10
  • Java 9
  • Java 8
  • Java 7

Meta Links

  • About Me
  • Contact Us
  • Privacy policy
  • Advertise
  • Guest and Sponsored Posts

Recommended Reading

  • 10 Life Lessons
  • Secure Hash Algorithms
  • How Web Servers work?
  • How Java I/O Works Internally?
  • Best Way to Learn Java
  • Java Best Practices Guide
  • Microservices Tutorial
  • REST API Tutorial
  • How to Start New Blog

Copyright © 2020 · HowToDoInjava.com · All Rights Reserved. | Sitemap

  • Java 15 New Features
  • Sealed Classes and Interfaces
  • EdDSA (Ed25519 / Ed448)