Results 1 to 6 of 6
  1. #1
    DCurro is offline Member
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Default javaw -jar works but javaw doesn't

    Hello everyone,

    In the command-line javaw -jar [something.jar] launches, but javaw [something.jar] does not launch.

    I am try to diagnose why my file association of javaw with .jar files resists execution. It works on my home pc, but not on my laptop.

    Both are running windows 7 and are using the most up to date Java7 development and runtime environments.

    If anyone knows a way to fix this, it would be much appreciated. If I can't fix this, I'll end up making .exe files out of my java applications, which isn't the way I'd want to go.

    Thanks,
    DCurro

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default Re: javaw -jar works but javaw doesn't

    javaw.exe is fairly silent about errors: there could be a missing class or something and you wouldn't know about it. Make sure the program runs using java before trying javaw and also make sure that it runs from the command line before associating the corresponding command with the file type.

    javaw (without -jar) should be given the name of a class to run, not the name of a jar file.

  3. #3
    DCurro is offline Member
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Default Re: javaw -jar works but javaw doesn't

    java -jar runs my jar file from the commandline
    javaw -jar runs my jar file from the commandline
    javaw doesn't run my jar file from the commandline (this works on my other computer)

    javaw is set as associated with the .jar type but double clicking doesn't execute anything.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,574
    Rep Power
    12

    Default Re: javaw -jar works but javaw doesn't

    javaw doesn't run my jar file from the commandline
    As noted above, I wouldn't expect it to. javaw.exe (and java.exe) used without -jar expect the name of a class, not a jar file. (See the "Synopsis" at the top of the man page.)

  5. #5
    DCurro is offline Member
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Default Re: javaw -jar works but javaw doesn't

    Understood, but my concern isn't with the command line. I'm looking to have my .jar applications launch upon a double click.

    I retested the same .jar files between my home computer and my laptop, and the results are that the home computer launches .jar files with the file association of javaw, whereas my laptop refuses to run .jar files with the association javaw.

    These two computers have the same operating system and java was set up on both computers on the same day.

  6. #6
    wiremite is offline Member
    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    Default Re: javaw -jar works but javaw doesn't

    Hi DCurro, did you happen to get this issue resolved? I am seeing the same symptoms. I can start my program from the command prompt with "java - jar my.jar" but double clicking, which I understand runs javaw, doesn't start my program. I built my Jar with NetBeans if that is any indication.

Similar Threads

  1. Why is javaw.exe Randomly Disappearing
    By Land Of Java in forum JavaFX
    Replies: 0
    Last Post: 10-05-2011, 09:43 PM
  2. Replies: 17
    Last Post: 08-22-2011, 01:22 AM
  3. javaw cpu
    By trishtren in forum New To Java
    Replies: 1
    Last Post: 04-18-2011, 03:13 PM
  4. javaw.exe problem in Task Manager
    By sarwar1234 in forum New To Java
    Replies: 5
    Last Post: 09-30-2010, 02:47 AM
  5. javaw.exe running jbroker.exe?????
    By fxRichard in forum Advanced Java
    Replies: 3
    Last Post: 05-12-2009, 12:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •