How to provide Runtime argument to java program through Eclipse?

Posted on 2006-05-31
Last Modified: 2008-01-09
I need to know how do I give a runtime argument to a java program while using Eclipse?

Like I know - using the command line I can give java myCompiledClass theArgument

How do I do the same thing with Eclilpse???

I had done it earlier but now forgot :)

Question by:_Esam
    LVL 2

    Assisted Solution

    On the "Run" dialog where you give it the name of your startup class there is a tab for arguments.

    I get to this tab by clicking the down arrow next to the Run toolbar icon and select the "Run..." menu item.

    Author Comment

    From   Run >> Arguments >> Then ??

    There are two text boxes/options ---- Program Arguments and VM Arguments?

    Do I simply provide the argument value there in the Program Argument???

    That's it?

    LVL 6

    Accepted Solution

    If you want to give program arguments you put it in "program arguments" textbox
    Take example
    java abc.abd.yourClass -h -m 50
    "-h -m 50" are your program arguments.
    java -Djava.xml.XMLParserFactory=org.dom4j.DOMXMLParser  abc.abd.yourClass
    "-Djava.xml.XMLParserFactory=org.dom4j.DOMXMLParser " is VM argument.
    LVL 30

    Assisted Solution


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    how to extract window origin in spring 2 55
    countClumps  challenge 10 70
    nested interface 5 30
    wordcount challenge 11 51
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now