Results 1 to 3 of 3
  1. #1
    wallacetju is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

    Default run multiple jar files by one click

    Hi everyone,
    Now I have 2 jar files, parser.jar and post.jar. Each file can run separately.

    I want to run them by one click.

    For example, combine them into one jar file (I am not sure if it's possible, because there seems like to be 2 main classes).

    Or maybe some scripts?

    Any suggestion is welcome!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

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

    Default

    Yes, you could write a script in whatever form your OS requires and run the two programs either one after the other or as two separate processes.

    Or you could write another Java class whose main method calls the main methods of the Main-Classes of the two jars - again, either one after the other, or in two separate threads.

    Exactly what will happen in any of these four senarios depends, of course, on what exactly the two programs do.

    If the two jar files both declare a class with the same name I don't know what will happen. Nothing good, I imagine.

Similar Threads

  1. Editable multiple line ToolTip on mouse right click
    By smitharavi in forum AWT / Swing
    Replies: 1
    Last Post: 12-18-2010, 10:34 AM
  2. Handling multiple WAV files and saving them into ONE
    By phil128 in forum Advanced Java
    Replies: 2
    Last Post: 12-11-2010, 02:31 PM
  3. Compiling Multiple Files
    By Chasingxsuns in forum New To Java
    Replies: 4
    Last Post: 02-12-2010, 01:22 PM
  4. Project containing multiple source files
    By mr smiley in forum Eclipse
    Replies: 0
    Last Post: 04-25-2009, 10:31 PM
  5. multiple class files
    By nemesys571 in forum Eclipse
    Replies: 0
    Last Post: 06-26-2008, 01:58 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
  •