How to add arguments in java command

hi All,
I am using ant for calling java command. How do I add more than 1 argument for <arg> tag ?.
<target name="A" depends="prepare" description="Starts the client" >
<java classname="Starter" fork="yes">
<args>
     <arg value="${clientArg1}"/>
     <arg value="${clientArg2}"/>
     </args>
</java>
</target>
Here i get an exception that "The <java> task doesn't support the nested "args" element.".
How do I pass more than one argument for java command ?.
Hoping for reply.
Thanks and regards,
Sachin P

Are you serious?
<project name="foo" default="doThatVoodoo">
    <property name="arg1" value="foo" />
    <property name="arg2" value="bar" />
    <target name="doThatVoodoo">
        <echo message="${arg1}"/>
        <echo message="${arg2}"/>
    </target>
</project>
C:\>ant -Darg1=mud -Darg2=bug
Buildfile: build.xml
doThatVoodoo:
     [echo] mud
     [echo] bug
BUILD SUCCESSFUL
Total time: 0 seconds

Similar Messages

  • How to add Args in java.exe from JNI

    Hi, there:
    Anyone knows how to put the arguments at the java.exe command line,
    involked from C++ code through JNI?

    This is additional information to my original forum topic.
    Here, I would like to have the involked java code to get
    the data file and its location as an argument of java.exe.
    So, not only does the java app start, but it starts with
    initial input data.
    Java involcation is done from VC++ using JNI 2 and jDK1.3.1.
    Thanks.

  • How to add menus in java?

    Hello,
    I am new to java technology.
    I just wanna know from smart java coder , how to add menus to main or mdi form?
    I will be very thankful for early response

    Hi,
    have a look :
    http://java.sun.com/docs/books/tutorial/uiswing/components/menu.html
    regards
    Nico

  • How to add node in Java system NW 7.3 ehp1

    Hi Everyone,
    Hoe to add node in JAva System in Nw 7.3 ehp1.
    Whats are point which need to keep in mind before adding node?
    Regards
    Adil

    Hi Adil,
    Follow the below steps
    1.Start the Config Tool by double-clicking the configtool script file in <SAP_install_dir>/<system_name>/<instance_name>/j2ee/configtool directory.
    2.choose the Java instance according to the level you want to make configurations.
    3.Choose the Servers tab.
    4.In the Custom Number of Server Processes field, enter the number of server processes you want to have. Click on set and save the configuration
    Choose Check Value to verify that your server is capable of handling the number of server processes you entered. Correct the value if necessary.
    Restart the java engine.
    You need adjust the heap memory accordingly
    SAP Note 723909 - Java VM settings for J2EE 6.40/7.0
    Checked the sapnote if java don't come up
    1658950 - J2EE System fails with "exitcode = -2"
    http://scn.sap.com/community/performance-scalability/blog/2013/08/29/java-memory-sizing-procedure-pragmatic-approach
    With Regards
    Ashutosh Chaturvedi

  • How to add path to "java.library.path" property?

    I use this command to set the "java.library.path" property:
    java -Djava.library.path=./libs    HelloWorldBut it will overwrite the default value. How can I add the path "./libs" to the default value of "java.library.path"?

    Have you tried
    -Djava.library.path=%PATH%;./libs The command search path is the only default I know. By the way, are you certain that the present working directory will always be the parent of "libs"?

  • How to "Reload Domain" via Java / Command line

    Hi,
    I am looking for a way to do the same as the button "Reload Domain" in enterprise manager does, but I need to do it from command line or from java.
    We have multiple CMSDK nodes running on different servers. As the ifsctl command runs into very long timeouts if any of the servers is unavailable, we implemented a small java service that's deactivating all nodes in the node configuration table if the servers becomes unavailable. We need this as we have only a very tight timeframe for failover scenarios, so we cannot accept that the ifsctl takes a long time during startup.
    The problem we now have is that the Domain Controller remembers the configuration as it was during startup. So if any Node was disabled and is started later, the node guardian is not contacted by the domain controller. If the "Reload Domain" button is pressed, the domain controller refreshes it configuration and the additional nodes start their services.
    The whole stuff runs within Veritas Cluster, so we need to find a way to get everything up without manual intervention (pressing the button in enterprise manager).
    Thanks for any advice / help
    Alex

    Assuming your are using Ant underneath the covers to build inside of NetBeans (often the case), you can go to the directory where your NetBeans project resides and run "ant" from the command-line for the project's root directory (there should be a build.xml file in that directory). To do this, you'll need to have Ant installed (including having ANT_HOME defined in your environment) and you'll need to have JAVA_HOME defined in your environment and pointing to your Java SDK directory. This may sound like a lot of work (downloading and installing Ant and setting the environment variables), but it is probably the easiest way to build your NetBeans project from the command-line because it is likely that your particular NetBeans project is already using Ant to build. In fact, instead of downloading Ant, you could use the NetBeans installation of Ant as long as your ANT_HOME points to the NetBeans-provided Ant directory. You'll probably want to add $ANT_HOME/bin or %ANT_HOME%\bin to your PATH as well so that that can run "ant" from any directory.

  • How to add WebDynpro (for Java) to iView in CE 7.1

    Hi experts,
    Currently trying CE 7.1 SP3. I have created the Web Dynpro project and wanted to add it in iView and subsequently to the Page. However, there isn't a Web Dynpro for Java  iView template selection.
    How do i add the web dynpro for Java to iView and subsequently?
    Thanks.

    Hi Aiwei,
    Please follow the steps to embedd an WebDynpro application in a page.
    Go to the Content Administration--> Portal Content
    Expand the Web Dynpro Applications . Browse the application created.
    Right Click on the Application and Copy.
    Expand the Portal Content folder and browse to the folder where  you want to create Page.
    Right click and click on Paste as PCD object.
    Regards,
    Niraj
    ps: Awards points if helpful.

  • How to add arguments and switches to AUT

    Hi,
    Usually when I start my AUT from terminal, I will use command like for example
    $ ./appname.bin
    This is internally called from RCPTT when it calls AUT. But some times I have to pass some arguments and switches. How shall I do that? Take for example the following,
    $ ./appname.bin -data @NoDefault
    How can call my AUT using these parameters or arguments and switches?
    Kindly let me know.
    Thanks
    Jeevan

    Hi Ulyana,
    I am not clear about what that link is about to say and I am not able to get my desired output using that. I don't want to pass VM arguments. I want to pass a Runtime Configuration argument which changes the behaviour of my application when I pass -data @noDefault while calling it.
    For example:
    When I call it "./appname.bin it opens normaly with an already default workspace
    When I call it "./appname.bin -data @noDefault" it will not take any default workspace and will ask me for choosing an workspace
    Hi Matias,
    I can do that, but I want to do this only for one particular test case and not for the entire AUT.
    Kindly let me know how to solve this.
    Thank you all
    Jeevn

  • How to add components in java studio creator (htmLib)

    Hi,
    I'd like to add htmLib.jar into the palette of Java Studio Creator or at least into my project. Does anyone know of a tutorial or know how to do this? In particular, I need help in adding htmLib into my project: http://jsftutorials.net/htmLib/
    Thanks,
    Marc

    To add jar files :
    From the main menu, Tools > Library Manager.
    In the Library Manager dialog box, click New Library.
    In the New Library dialog box, enter the library name.
    Choose the library type and click OK.
    Click Add JAR File/Folder to browse for and add JAR files to the library reference.
    Click OK.
    In the Projects window, right-click the Libraries node and choose Add Library.
    In the Add Library dialog box, select the library reference.
    Click Add Library.

  • How to add proxy to dtexec command line to run ssis package

    Hi all!
    I am in badly need to your help to solve my problem
    i build an ssis package to read xml data from API and load it in a local DB
    and i created an ajent sql job to schedule run this package and thanks god it worked well..
    BUT..
    When i changed my network that i must use a proxy (**.**.***.***:8080) to connect to internet
    the scheduled job didn't work !!
    i guess i must add this proxy server to the DTEXEC command line that i use in my scheduled job
    waiting for your help please..
    Thanks

    Dear all 
    really Thanks a lot .. PROBLEM SOLVED :)
    i created a new credential using my windows account and then i created a new proxy account using my new credential and finally i use this proxy account in sql agent job and it works well 
    i guess that the problem is SQL Server Agent uses SQL
    Server credentials to launch the job, not Windows
    credentials .
    Thanks

  • How to add elements into java string array?

    I open a file and want to put the contents in a string array. I tried as below.
    String[] names;
    s = new Scanner(new BufferedReader(new FileReader("outfile.txt")));
    while (s.hasNext()) {
                    String item = s.next();
                    item.trim();
                    email = item;
                    names = email;
                }But I know that this is a wrong way of adding elements into my string array names []. How do I do it? Thanks.

    Actually you cannot increase the size of a String array. But you can create a temp array with the lengt = lengthofarray+1 and use arraycopy method to copy all elements to new array, then you can assign the value of string at the end of the temp array
    I would use this one:
    String [] sArray = null;
    s = new Scanner(new BufferedReader(new FileReader("outfile.txt")));
    while (s.hasNext()) {
        String item = s.next();
        item.trim();
        email = item;
        sArray = addToStringArray(sArray, email);
    * Method for increasing the size of a String Array with the given string.
    * Given string will be added at the end of the String array.
    * @param sArray String array to be increased. If null, an array will be returned with one element: String s
    * @param s String to be added to the end of the array. If null, sArray will be returned.(No change)
    * @return sArray increased with String s
    public String[] addToStringArray (String[] sArray, String s){
         if (sArray == null){
              if (s!= null){
                   String[] temp = {s};
                   return temp;
              }else{
                   return null;
         }else{
              if (s!= null){
                   String[] temp = new String[sArray.length+1];
                   System.arraycopy(sArray,0,temp,0,sArray.length);
                   temp[temp.length-1] = s;
                   return temp;
              }else{
                   return sArray;
    }Edited by: mimdalli on May 4, 2009 8:22 AM
    Edited by: mimdalli on May 4, 2009 8:26 AM
    Edited by: mimdalli on May 4, 2009 8:27 AM

  • JBuilder question on how to add a new .java file

    I am new to Java and even newer to JBuilder. I am creating the GUI for our school project and my other members are creating the networking and database parts of our program seperatly. I am at the point were I need to import their .java files into my project I created in JBuilder.
    Can someone tell me the steps I need to take to get those files into my project so I can start using the classes from my group they made up?
    Thanks,
    Scott

    You can use show_alert statement and then make a check on button that is pressed from the alert.
    Here is an example of show_alert built_in.
    DECLARE
      my_alert number;
      ALERT_TXT     VARCHAR2(200) := 'Do you want to delete record?';
    BEGIN
         set_alert_property('your_alert',ALERT_MESSAGE_TEXT,ALERT_TXT);
           my_alert := show_alert('your_alert');
           If my_alert = Alert_Button1 Then
             /** I choose to delete record **/
            -- here you can put your statements
           else
           -- I pressed NO button
           -- here you can put your statements
           end if;
    END;Hope it helps you,
    Fabrizio
    If this answer is helpful or correct, please mark it. Thanks.

  • How to add the missing java.lang.object

    hi guies:
    when i build the ui dc, an error occurs. it reminds me that the path is incomplete.the compliation indirectly references the missing type java.lang.object.
    if you once confronted the same problem as me and resolved it ,pls told me.
    thanks a million!

    The JDK is not in path of the DC build.
    Hence you are getting this error.
    Check that correct JDK is pointed in preferences.
    Regards,
    Ashwani Kr Sharma

  • How to invoke "javac" and "java" command so that I can write my complier

    thanks

    Have a look in tools.jar under sun.tools.javac.Main is the standard javac complier.
    You can decompile this library and get a good idea of what goes into writing a compiler.
    If you want to write your own compiler you might find creating a MyLanguage to java translator will be easier to build.

  • How to add to java classpath?

    I am wondering how to add/implement to java classpath. I think I might be missed out the classpath thing so my program doesn't work. I keep getting error message like: "cannot resolve symbol: method setDocumentHandler(BookCounter)" and warning messages like: "C:\Example\BookCounter.java :11: warning:org.xml.sax.HandlerBase in org.xml.sax has been deprecated." and "C:\Example\BookCounter.java :16: warning:org.xml.sax.HandlerBase in org.xml.sax has been deprecated."
    If this is not because of classpath problem, kindly let me know what should I do?
    My code as follow:-
    ========================
    import java.io.*;
    import org.xml.sax.*;
    import org.xml.sax.HandlerBase;
    import javax.xml.parsers.SAXParserFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    public class BookCounter extends HandlerBase
    private int count = 0;
    public static void main (String args[]) throws Exception
    (new BookCounter()).countBooks();
    public void countBooks() throws Exception
    SAXParserFactory f = SAXParserFactory.newInstance();
    SAXParser f2 = f.newSAXParser();
    // Parser p = new com.jclark.xml.sax.Driver();
    f2.setDocumentHandler(this);
    f2.parse("file:///C:/books.xml");
    public void startElement(String name) throws SAXException
    if (name.equals("book"))
    count++;
    public void endDocument() throws SAXException
    System.out.printIn("There are" + count + "books");

    The errors don't look like classpath problems. The first one is a result of it not being able to find a method in BookCounter (or more likely HandlerBase) that has the signature that you are attempting to use.
    The warnings come from the fact that HandlerBase has been deprecated, just like the messages state. In other words, it has been replaced by a newer version, or incorporated into another class' functionality. Check the API for more information.

Maybe you are looking for

  • How can i show item schedule line details in Tableview for each line item

    Hai all,   I need to display schedule line details  in Tableview for each line item.for example in each row i need to put one column along with button , if i click on this table that row  should be expand vertically and must show all schedule line de

  • How to present result of DB-Query blasting all formats in width

    Hi, i'm searching for an idea/solution for the problem: Users of my form shall be able to choose an item of a result list of a DB-Query. Unfortunatelly there are too many attributes with alternating length per line, that have to be showed there. Usin

  • Using a floor plan as a map to show in OBIEE 11g

    Hi, I have a floor plan of a shopping center and would like to highlight facts such as revenue over each shop on the floor. Does anyone know how you would create the spatial information that would be needed to map out the boundry of each shop on the

  • Adding a duplicate pages to a Form

    I am having a problem adding or "copying" the master page or page one to make duplicate pages with the same form fields. I am trying to make a form that requires input with regards to the steps required to construct a project. The "Page Add" button i

  • The screen get stucked.

    The screen of my Ipod nano get stucked by a song. And now you only see that song And when i connect the i-pod to the computer, you dont see the ipod at iTunes. If you push a button it wont help.