• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java and javaw

 
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Friends,

I have a '.bat' file from which an executable jar is called. If i use

start javaw -jar <jarname> its not working but if i use

start java -jar <jarname> thejar gets executed.

I'm not calling any GUI application from the jar. The jar contains an ordinary class file.

What is the exact difference between java and javaw?

Kindly provide your help.

Regards,
Vijay
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java keeps running until the application ends. If you call it from a shortcut, it opens a command box which won't close until the application ends.

javaw starts the application in a separate process, then exits immediately. If you call it from a shortcut, there won't be a command box. It should usually only be used with GUI (AWT/Swing/SWT/...) applications, because you can't interact with any command line application nor see its output.


So what is probably happening with your .bat file is that it is a command line application, and you don't see the command box like you're used to.
 
Beware the other head of science - it bites! Nibble on this message:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic