Results 1 to 3 of 3
  1. #1
    gayathri_g is offline Member
    Join Date
    Aug 2009
    Posts
    9
    Rep Power
    0

    Default running two jar files

    Hai all,
    I like to know how to run two jar files at a time?please help me.

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    What do you mean by that?
    You can only specify one main entry point to start a program.

  3. #3
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    8

    Default

    Easy enough, just do something like this:

    Java Code:
    String jar1 = "java -jar MyJar1.jar"; // you will need to put in the path to that jar
    String jar2 = "java -jar MyJar2.jar"; // you will need to put in the path to that jar
    
    Runtime.getRuntime().exec(jar1);
    Runtime.getRuntime().exec(jar2);
    I have something similar to spawn multiple instances of my server from a manager app.
    Last edited by mrmatt1111; 09-02-2009 at 09:15 PM.
    My Hobby Project: LegacyClone

Similar Threads

  1. Replies: 0
    Last Post: 08-26-2009, 01:03 PM
  2. Replies: 6
    Last Post: 02-06-2009, 09:05 PM
  3. Replies: 1
    Last Post: 01-16-2009, 11:14 AM
  4. Running batch files in java
    By pradeesh in forum New To Java
    Replies: 10
    Last Post: 12-04-2008, 10:26 PM
  5. running .class files on a website
    By jklsemicolon in forum Networking
    Replies: 10
    Last Post: 08-08-2008, 06:21 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
  •