Results 1 to 7 of 7
  1. #1
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default Double clicking executables jar files?

    My windows xp got a little damaged a little while ago, the registered file types are a bit damaged as well, one of the damge was done to the the jar files

    Im trying to find out what program used to run the jar files from the registered file types menu in XP folder options, it must have use either java or javaw just like how i usually opened it from cmd

    The problem is, i tried entering java.exe as the opener, tried javaw.exe too, both from the JDK's bin, not the JRE's, but when i double click the jar file, it wont open the jar application, the manifest are okay since i tried running it in another computer and the application works, its just the opener path that are troubled

    This is my JDK's bin path, the one that i type as the opener
    C:\Program Files\Java\jdk1.6.0\bin

    I know i must've missed something, anyone can help me?

  2. #2
    dmacvittie is offline Member
    Join Date
    Aug 2007
    Posts
    30
    Rep Power
    0

    Default

    Try this:
    "C:\Program Files\Java\jdk1.6.0\bin\javaw.exe" -jar "%1" %*

    Don.
    Don MacVittie F5 Networks - DevCentral

  3. #3
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default

    It worked :)
    Thanks a lot Don
    Btw, care to explain the parameter there?
    I understand bout the -jar, but what does this part means?
    Quote Originally Posted by dmacvittie
    ..."%1" %*

  4. #4
    dmacvittie is offline Member
    Join Date
    Aug 2007
    Posts
    30
    Rep Power
    0

    Default

    Sure thing. The %1 is used to say "the first parameter" in this case that would be the file you double-clicked on.

    Don.
    Don MacVittie F5 Networks - DevCentral

  5. #5
    cruxblack is offline Senior Member
    Join Date
    Jul 2007
    Posts
    130
    Rep Power
    0

    Default

    "%1" are the first parameter passed?
    Hmm...okay, what about the %* afterwards?
    Some kinda pointer?:confused:

  6. #6
    jasmu is offline Member
    Join Date
    Apr 2009
    Posts
    17
    Rep Power
    0

    Default

    I too had same problem, if i double click, no action is happening


    Path for the jar file is,

    "C:\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*

    like that only.

    Can you tell me, what was the problem

  7. #7
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    One point about jar files... they do not automatically create command prompts, so any command line programs WILL NOT function if a batch file (*.bat) is not used. Batch files use cmd and then the command. If the batch file is in the same directory as the jar file, you only need to use something like the example below
    Java Code:
    cmd /c java -jar HelpWithCounting.jar
    As for common errors,,, forgetting -jar fileName is a common one
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. Replies: 7
    Last Post: 05-09-2008, 08:54 AM
  2. Calculating sin of a double value
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-13-2008, 09:13 PM
  3. Java3D: Clicking and getting coordinates?
    By seabhcan in forum Advanced Java
    Replies: 0
    Last Post: 01-11-2008, 03:46 PM
  4. Getting smallest possible Double value
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-06-2007, 03:15 PM
  5. How to round a double?
    By Valeriano in forum New To Java
    Replies: 1
    Last Post: 05-31-2007, 04:50 PM

Posting Permissions

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