java vs javaw vs javaws

This article gives an awareness tip. Do you know the difference between java, javaw and javaws tools. All these three are java application launchers. We know well about java.exe which we use quite often. Our command line friend, mostly we use it for convenience to execute small java programs. javaw is rare for us. Sometimes we have seen that in running application list in windows task manager. javaws is web start utility.


We need to know about jvm.dll also. This is the actual java virtual machine implementation in windows environment and it is part of the JRE. A ‘C’ program can use this jvm.dll directly to run the jvm.


java.exe is a Win32 console application. This is provided as a helper so that, instead of using jvm.dll we can execute java classes. As it is a Win32 console application, obviously it is associated with a console and it launches it when executed.

Ads by Google


javaw.exe is very similar to java.exe. It can be considered as a parallel twin. It is a Win32 GUI application. This is provided as a helper so that application launches its own GUI window and will not launch a console. Whenever we want to run a GUI based application and don’t require a command console, we can use this as application launcher. For example to launch Eclipse this javaw.exe is used. Write a small java hello world program and run it as “javaw HelloWorld” using a command prompt. Silence! nothing happens then how do I ensure it. Write the same using Swing and execute it you will see the GUI launched. For the lazy to ensure that it is same as java.exe (only difference is console) “javaw HelloWorld >> output.txt”. It silently interprets and pushes the output to the text file.

import javax.swing.*;

public class HelloWorldSwing {
    private static void createAndShowGUI() {
        JFrame jFrame = new JFrame("HelloWorld Swing");
        JLabel helloLabel = new JLabel("Hello World!");

    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {

We can execute the above GUI application using both java.exe and javaw.exe If we launch using java.exe, 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.


javaws.exe is used to launch a java application that is distributed through web. We have a jnlp_url associated with such application. We can use as “javaws jnlp_url” to launch the application. It downloads the application from the url and launches it. It is useful to distribute application to users and gives central control to provide updates and ensures all the users are using the latest software. When the application is invoked, it is cached in the local computer. Every time it is launched, it checks if there is any update available from the distributor.

This Core Java tutorial was added on 07/08/2012.



Comments on “java vs javaw vs javaws”

  1. Sudheer

    Good one…..I saw javaw.exe in the task manager and kind of knew that it is associated with eclipse process. Now I got clear picture..

  2. Anonymous

    very nice……

  3. Bharani

    Simple and Elegant Joe.

  4. Khaleel

    Excellent JOB !!!

    Can you write a topic on how to design/write API for a new application or product?


  5. Manishkumar Modi

    Very Nice…
    I have run above Swing GUI application using java.exe and javaw.exe
    Now I got the clear picture..
    Very nice,, Awesome

  6. Anonymous

    This is great!


  7. Thilina Gallage

    Amazing explanation !

    Keep up the good work Joe…

  8. shubham

    good explanation

  9. Githin

    it was a new knowledge.

  10. Samatha

    Very nicely put. Thanks.

  11. Rashi Coorg

    Very nice one! Thanks a lot.

  12. Sandeep Singh

    Thanks .. Nice explanation

  13. Prasad

    Thanks for this valuable information.

  14. Mukesh kumar Singh


    javaw not work properly please if it is possible write the command lines.

  15. Anonymous

    Simply fantastic …

  16. Jayani

    Hi Joe, your blogs are really nice and very helpful indeed. I am studying design patterns since last few days and I often refer to your blogs. Thank you for sharing this information

  17. kruthi

    Find it very interesting……….

  18. Raj

    I am a beginner and I really understand the way you explain the concepts. Good job! Thanks a lot

  19. Anonymous

    very nice …….

  20. subash

    i know something..

  21. Misge

    Nice to know I can use jvm.dll .

  22. Krisk

    So no javaw under Linux….

    Nice blog, keep posting!

  23. Anonymous

    nice blog and v usefull…..

  24. Jegadeesh


  25. Subrat

    Nice explanation..I didn’t know why we are using javaws.Got the clear picture.
    Thanks man!!!!
    Good job keep it up!!:)

  26. ravi suthar

    when i execute my jar file. i saw javaw.exe is running in my task manager.

  27. Someone

    Very Good Information…


  28. How can we close a program that was executed through javaw. for example if I made a program and it is running irrespective of console being open or close. how to kill that process?

  29. Nice article! Thanks

  30. Anonymous

    Good one, especially javaws part. By the way you can also check Difference between java and javaw command.

  31. ritesh singh

    Very useful.

  32. Anonymous

    very useful

    Could you please explain javaws with one example

  33. Raks

    Good one Joe…

  34. Jyoti

    Good useful Info Joe…

  35. parthimahesh

    it’s useful one.i understand differents between these and purpose.


  36. Vijendra Yadav

    Hey Joe,

    Very nice explanation, and also very knowledgeable.


  37. Anonymous

    Nice.. thanks.

  38. this is useful. actually i also writing about core java with easy language .i like the way you explained the thing

  39. Vinod Gulia

    This is really helpful…..

  40. Anonymous

    very useful info..

  41. Arun

    Good explanation

  42. chandan modi

    one word……….awesom……….joe…………….keep it up


    I love JOSHEP and MKYONG…..realy a great contribution to help new lovers of java

  44. This blog is one of the best blogs i’ve seen on internet. Though Java is not my subject of interest,this site helped me a lot to learn design patterns,thank you mr joe.

  45. Mubarak Ali

    Thanks Joe.

  46. Very good Joe, thank you very much…

  47. Anonymous

    u explained very nicely. I never knew this things in java. Thanks a ton!

  48. Vinay

    Excellent work … Good Explanation….

  49. Murugesh

    Good explanation


    Dear All,

    This blog is very usefull to students,java developers,mobile applications developers,java faculty,etc.
    Keep updating many information.

  51. Satya

    It explains very simple.

  52. Mike

    Thank You Joe.

    Those that really know can explain with clear simplicity.

  53. I enjoy reading your posts. Thanks a lot for sharing it with all of us. Could you please share some interesting facts related to jdbc.

  54. Rajesh Kumar

    Hi Joe,
    Could you please elaborate the part jnlp_url from javaws.exe. Actually I am working on a java web start application which does not have .jnlp file. And it also does not contain main() method. Then how the deployment can be done? Any help will be appreciated! Thanks in Advance…

    • ranga

      jnlp file should be describe the main method where it is in java class.


      The Java(tm) Tutorial

      Demonstrates use of buttons within containers

      above code save into Buttondemo.jnlp and then

      in command prompt use like this > javaw ButtonDemo.jnlp then enter then u will get application.

  55. @ramesh

    could you please give me an example of how javaws is used.

  56. Suyash


    Great work!!!!
    This blogs seems to be very helpful to collect all the basic and advance knowledge of JAVA.

    Suyash Bhalekar

  57. Manoj Kumar

    What kind of person you are, I feel blessed wberytime I go through your blogs.. Thanks a lot for being there for us.

  58. Amit

    Simply superb !!

  59. Manoj Sharma

    Nice one.
    Its a very helpful for me.

    Thanks a lot Joe.

  60. Anonymous

    very nice explanation

  61. Abhay

    Thanks Joe… this was a life saver. Even after using Java for such a long time, I never knew the difference.
    I had to write a program that would run in the background but still interact with the UI. Instead of creating complicated services and a different UI, this helped me achieve my goal in 30 sec.
    I owe you a beer.

  62. Omkar

    Could you please give me an example of how to use javaws like javaw?
    Because i didn’t get the clarity with javaws than javaw.

  63. Omkar

    I saw.. java.exe, javaw.exe, javaws.exe
    in both jdk/bin and jre/bin directories.
    As per my understanding jdk is a development kit
    that’s why it contains the java compiler javac.exe.
    and JRE is the runtime environment
    having the JVM in the form of java.exe.
    So, but why java.exe is also in jdk/bin folder?
    could you please clarify me?

  64. Pravin Jose

    Thanks for the nice explanation.

  65. Yadav Kar

    Hi Joe,
    i Am facing a wired problem while launching Dynamic JNLP from JSP.

    Every time the web application launches JNLP from JSP, it creates a new javaw*32 process in task manager.

    if a user has launched it 30 times, then we can see 30 javaw*32 processes in task manager.
    It causes the application freeze sometime.
    Could you please suggest us How to handle this scenario.

    Note: If i would use system.exit(0) in finally block of jsp then i think i will kill the process of application itself.

  66. naveen

    Thank you. This was of help to me. Keep up the good work.

  67. Somdev

    Nice explanation.

  68. Naveen

    i can understand about java.exe javaw.exe tools.try to give the example for javaws.exe tool where it will be used?

  69. Naveen

    very good stuff.Very nice explanation

Your Comment