Open Command Window when Double Clicking jar

Discussion in 'Java' started by m97rek, Oct 4, 2007.

  1. m97rek

    m97rek Guest

    Hi,


    I have jar file which is nothing more than a command line application
    (think Hello World). It works fine from the command prompt but I would
    like it to work when double clicking it. When I do so nothing happen.
    I assume that the application actually runs in the background.

    I run Windows XP if that matter.

    Thanks
     
    m97rek, Oct 4, 2007
    #1
    1. Advertising

  2. m97rek

    bcr666 Guest

    On Oct 4, 9:33 am, m97rek <> wrote:
    > Hi,
    >
    > I have jar file which is nothing more than a command line application
    > (think Hello World). It works fine from the command prompt but I would
    > like it to work when double clicking it. When I do so nothing happen.
    > I assume that the application actually runs in the background.
    >
    > I run Windows XP if that matter.
    >
    > Thanks


    Your problem might be in that when you double click on the Icon, the
    program opens a console window, runs, then closes the window. To get
    around this, you can either make your program not close (or take some
    user action to close), or you can write a batch file that takes a
    parameter (jar file) and executes it, then issues a dos "pause"
    command. If you use the second option, you'll need to make sure
    windows sends the file to the batch program when you double click on
    the .jar.
     
    bcr666, Oct 4, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    587
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,732
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,774
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    672
    Arnold Peters
    Jan 5, 2005
  5. Sydex
    Replies:
    12
    Views:
    6,507
    Victor Bazarov
    Feb 17, 2005
Loading...

Share This Page