Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Adding command line arguments to batch file produced from Ant build script

Adding command line arguments to batch file produced from Ant build script

Scheduled Pinned Locked Moved Java
javatoolsquestionlounge
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    faheemnadeem
    wrote on last edited by
    #1

    Hi, I have an ant build script as shown below.

    <target name="runscript" depends="compile">
    <echo file="run.sh" append="false">java -cp ${mclib}/mundocore.jar:bin Chat</echo>
    <chmod file="run.sh" perm="+x"/>
    <echo file="run.bat" append="false">java -cp ${mclib}/mundocore.jar;bin Chat</echo>
    </target>

    The build script portion produces a batch file named run.bat, which simply executes a java compiler command.

    java -cp C:\mundocore-1.0.0-RC1\lib\se/mundocore.jar;bin Chat

    I want to send some commandline arguments with the run.bat script.e.g in command prompt

    run.bat hello

    How can i change the the ant build script to generate a batch file that can accept arbitrary number of command line arguments. Thanks in advance...

    T 1 Reply Last reply
    0
    • F faheemnadeem

      Hi, I have an ant build script as shown below.

      <target name="runscript" depends="compile">
      <echo file="run.sh" append="false">java -cp ${mclib}/mundocore.jar:bin Chat</echo>
      <chmod file="run.sh" perm="+x"/>
      <echo file="run.bat" append="false">java -cp ${mclib}/mundocore.jar;bin Chat</echo>
      </target>

      The build script portion produces a batch file named run.bat, which simply executes a java compiler command.

      java -cp C:\mundocore-1.0.0-RC1\lib\se/mundocore.jar;bin Chat

      I want to send some commandline arguments with the run.bat script.e.g in command prompt

      run.bat hello

      How can i change the the ant build script to generate a batch file that can accept arbitrary number of command line arguments. Thanks in advance...

      T Offline
      T Offline
      Tarakeshwar Reddy
      wrote on last edited by
      #2

      Take a look at this discussion[^].

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups