Results 1 to 13 of 13
  1. #1
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default How to launch an executable .jar appication on another PC?

    Hi All,

    I made a .jar file in Intellij Idea 12. It works. But when I try to open it on another PC, the Winrar loads it. There are no other options. The other PC has jre7 but not jdk. What do I do to make the jar file to run on this PC? Do I need jdk? (I do not want to install jdk on the other PC if I do not have to.)

    Thank you very much.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: How to launch an executable .jar appication on another PC?

    You neglected to mention the OS on the other PC, which is significant for giving proper advice.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default Re: How to launch an executable .jar appication on another PC?

    The developing PC is Windows 7 Ultimate. The other PC is Windows 7 home premium Sony laptop.

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: How to launch an executable .jar appication on another PC?

    Set the .jar file association as follows:

    Right-click any executable .jar
    Select Open With
    Select Choose Default Program
    Navigate to java/jreX/bin/
    Select Javaw.exe
    Click Open
    Make sure "Always use the selected program to open this kind of file' is checked
    Click OK

    Since this is not a Java problem per se I'm moving the thread to the Forum Lobby.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: How to launch an executable .jar appication on another PC?

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default Re: How to launch an executable .jar appication on another PC?

    It did not work. Nothing happened. The application that opens the jar file is Java Platform SE Binary. Anyway, my goal is to use the mouse double-click to run the jar executable. Thanks.

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: How to launch an executable .jar appication on another PC?

    Quote Originally Posted by yma16 View Post
    It did not work. Nothing happened. The application that opens the jar file is Java Platform SE Binary. Anyway, my goal is to use the mouse double-click to run the jar executable. Thanks.
    Java Platform SE binary could be jave.exe or javaw.exe. Did you read and follow the exact steps I outlined? On which computer? The development machine or the 'other' PC?

    Also check whether Winrar has a setting to recapture its file associations, and if it does than disable it.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: How to launch an executable .jar appication on another PC?

    Quote Originally Posted by yma16 View Post
    my goal is to use the mouse double-click to run the jar executable.
    I'll add this: if you're going to write and distribute programs, in Java or any other language, you need to devote some time to learning and understanding your OS and any other on which you want your programs to run. Of course, a Java forum isn't the best place for that; there are Windows, Linux and Mac forums targeted to each of the common PC systems.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  9. #9
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default Re: How to launch an executable .jar appication on another PC?

    I removed jar file type from winrar so that winrar did not load the jar file. I used javaw.exe to open the jar file on the other PC. Nothing happens. Thank you for help.

  10. #10
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: How to launch an executable .jar appication on another PC?

    Then it looks like it could be a Java problem after all. Try this, on the 'other' PC:

    Launch a Command Prompt
    Navigate to the folder that contains the .jar
    Run the jar using java -jar xxx.jar (Note: java, not javaw.

    Any errors or exceptions shown in the Command Prompt window?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  11. #11
    yma16 is offline Member
    Join Date
    Apr 2011
    Posts
    52
    Rep Power
    0

    Default Re: How to launch an executable .jar appication on another PC?

    java -jar xxx.jar will run the jar application. The only error is an I/O exception. The jar file reads from an input text file and creates an output text file. But the input data is not shown inside the jar application's window and the output file is not created.

  12. #12
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: How to launch an executable .jar appication on another PC?

    Quote Originally Posted by yma16 View Post
    The only error is an I/O exception.
    If you need help with that error, start a new thread in the New to Java section, showing relevant code. Don't forget to wrap your code in code tags to preserve formatting.

    But the input data is not shown inside the jar application's window and the output file is not created.
    After an IOException, should it?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  13. #13
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,570
    Rep Power
    25

    Default Re: How to launch an executable .jar appication on another PC?

    On my version(s) of windows (XP and 7 Home) there is a registry entry for .jar files that refers to another entry that contains command lines for executing jar files. I use the Right-click context menu for selecting which command line to use. I have several.

    The problem with using the OS to associate a command with a filetype is the problem of getting the -jar option into the command line. I think I've seen an app that does that but can not remember where or what. I've used the regedit program for years and tend to use it vs another app.
    The jre install should set the registry entry for .jar files. The problem is other programs can change the entry for their purposes.
    I've renamed the second registry entry to a unique name so that program installs don't wipe out my list of commandlines.
    When a product changes the .jar entry, I can easily change it back to refer to my list of commandlines.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Eclipse ME is not able to launch emulator
    By jazz123 in forum Eclipse
    Replies: 0
    Last Post: 03-23-2012, 09:55 PM
  2. create windows executable using executable jar file
    By sarwar1234 in forum New To Java
    Replies: 2
    Last Post: 02-07-2011, 08:29 PM
  3. Launch Jar from in application
    By hardcorebadger in forum New To Java
    Replies: 3
    Last Post: 01-25-2011, 06:03 AM
  4. Launch configuration
    By skittle in forum Eclipse
    Replies: 0
    Last Post: 02-28-2010, 11:57 PM
  5. Launch Error
    By roughjj in forum Eclipse
    Replies: 1
    Last Post: 10-30-2009, 07:59 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
  •