Results 1 to 5 of 5
  1. #1
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

    Default Command Line Arguments with executable JAR

    I have a jar file that takes command line arguments.. Running it from command line or via bat file is fine. Is there any way that I can run this file with arguments I set in bat file, by double-clicking that jar file?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,248
    Blog Entries
    7
    Rep Power
    24

    Default Re: Command Line Arguments with executable JAR

    Quote Originally Posted by allaudin View Post
    I have a jar file that takes command line arguments.. Running it from command line or via bat file is fine. Is there any way that I can run this file with arguments I set in bat file, by double-clicking that jar file?
    If you double click on that .jar file the .bat file obviously won't be started so no, it isn't possible.

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  3. #3
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

    Default Re: Command Line Arguments with executable JAR

    any other method of setting command-line arguments within the jar file ?

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,248
    Blog Entries
    7
    Rep Power
    24

    Default Re: Command Line Arguments with executable JAR

    It's the same as if you're running a single class.

    Jos
    The only person who got everything done by Friday was Robinson Crusoe.

  5. #5
    allaudin's Avatar
    allaudin is offline Senior Member
    Join Date
    Apr 2013
    Location
    Pakistan
    Posts
    273
    Rep Power
    0

Similar Threads

  1. What are command-line arguments?
    By Kratos321 in forum New To Java
    Replies: 12
    Last Post: 03-18-2012, 11:59 PM
  2. Command-Line Arguments
    By smvolt in forum Eclipse
    Replies: 6
    Last Post: 12-21-2011, 02:48 PM
  3. Command-Line Arguments
    By mustachMan in forum New To Java
    Replies: 5
    Last Post: 02-26-2010, 04:13 AM
  4. Command Line Arguments
    By Nakira in forum NetBeans
    Replies: 10
    Last Post: 02-04-2010, 04:45 PM
  5. arguments in command-line
    By girlet18 in forum New To Java
    Replies: 2
    Last Post: 01-21-2010, 03:05 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
  •