How to pass an argument to a standalone java class in JDeveloper

To the experienced:
In JDeveloper when you write a java class with a main() method that takes no argument, you just right click the java file and select Run to run the program. But suppose the main() method takes arguments, how do you pass your arguments to the program? This is especially a problem as I use the studio version of JDeveloper (Versions 10.1.3.4 and 11.1.1.3) that each uses the version of JDK bundled with it, rather than the JDK (which is yet another different version) installed at the OS level of the PC.
Many thanks for your help!
Newman

Hi, Puthanampatti,
Suppose a java class has a main() method:
<pre>
public class FormatTerm {
public static void main(String[] args) {
String year = args[0];
String semester = args[1];
</pre>
What I want to know is how to pass the arguments when invoking FormatTerm within JDeveloper (i.e., without going out of JDeveloper to invoke FormatTerm on a command line in DOS). I would appreciate it very much if you know how to do that in JDeveloper 11g (I use Version 11.1.1.3) and could help me out.
Thank you very much for your help!
Newman

Similar Messages

  • How to get user information in a standalone java class

    Is there a way to retrieve it in a stand alone java class (with no access to request object)? If so how do I get it?
    Thanks,
    Deepak

    Hi
    use this
    IWDClientUser currentUsers[]=WDClientUser.getClientUsers();
              //Displaying the count of logged on users
              wdComponentAPI.getMessageManager().reportSuccess("Number of logged on Users in the portal - "+(currentUsers.length-1));
              for(int i=0;i<currentUsers.length;i++){
                 if(currentUsers<i>!=null){
                     // Displaying the logged on users;
                     if(!currentUsers<i>.getLastName().equals("Guest")){
                          String first= currentUsers<i>.getFirstName();
                          wdComponentAPI.getMessageManager().reportSuccess("User - "currentUsers<i>.getFirstName()" "+currentUsers<i>.getLastName());
        //@@end

  • How to pass the arguments dynamically to a Oracle procedure.

    Hi all..
    How to pass the arguments dynamically to a procedure.
    Thanks in Advance.

    I have a concurremt program which has 5 parameters right now. The user can add more parameters from front end as per their requirement.
    So that time.. the 6th parameter has to add to my procedure dynamically.
    Thanks.

  • How to pass Cascading Parameter in SSRS using Java

    How to pass Cascading Parameter in SSRS using Java---
    We are having a problem with dependent parameters.There are three drop down--
    1.first dropdown is of Country.When we select a country--Accordingly next dropdown(State)will populate
    2.Second dropdown is of State. When we select a state--Accordingly next dropdown(City)will populate.
    I have three data sources are
    CountryList-
    SELECT CountryRegionCode, Name
    FROM Person.CountryRegion
    ORDER BY Name
    StateList
    SELECT StateProvinceID, StateProvinceCode, CountryRegionCode
    FROM Person.StateProvince
    WHERE CountryRegionCode = @CountryRegionCode
    ORDER BY StateProvinceCode
    CityList
    SELECT StateProvinceID, City
    FROM Person.Address
    GROUP BY StateProvinceID, City
    HAVING (StateProvinceID = @StateProvinceID)
    ORDER BY City
    Ihave to show report that has been deployed on server on the besis of these parameters
    I am using ReportViewer in JSP Page through url--
    http://192.168.90.149/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project1%2fCascading_Parameters&rs:Command=Render&rs:parameter=true&Country="+Country+"&State="+State;
    But it is not accepting parameter if they are cascaded.It is working fine if Both parameters are independent.
    Edited by: kaushlee on May 11, 2010 9:22 PM

    Take a look at set_custom_property:
    public static final ID SETTEXT = ID.registerProperty("SETTEXT");
    public boolean setProperty(ID pid, Object value)
        if (pid == SETTEXT)
    String text = value.toString();
    and in forms
    set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
    cheers

  • How to pass a JavaScript variable into a java method

    I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    myValue = someDynamicValue;
    <% System.out.println(myValue)%>
    </script>
    </head>
    <body>
    </body>
    </html>
    obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
    I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
    NOTE: the java method does not have to be a println() method, it can be any method of my choice.
    NOTE: someDynamicValue is a JavaScript value that can dynamically change

    I don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
    Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side.

  • How to Pass Click Value to DB using Java

    How to Pass Click Value to DB using Java and display tat
    clicked value row data in flex
    i have created connection with Sql Server using java and drew
    pie chart from values fetched from XML file created by Java
    wat i need is when i click pie chart region (widget) i should
    display a alert by giving value of particular widget name and Value
    from Database and display in Flex Alert

    Use AddResource to add Javascript in your BackingBean Code and pass the value to your javascript code.
    JSCookMenu and other dynamic adding of javascript to a JSF-JSP page is done using AddResource....

  • How to  get the profile object in simple java class  (Property accessor)

    Hi All,
    Please guide me how to get the profile object in simple java class (Property accessor) which is extending the RepositoryPropertyDescriptor.
    I have one requirement where i need the profile object i.e i have store id which is tied to profile .so i need the profile object in the property accessor of the SKU item descriptor property, which is extending RepositoryPropertyDescriptor.
    a.I dont have request object also to do request.resolvename.
    b.It is not a component to create setter and getter.It is simple java class which is extending the RepositoryPropertyDescriptor.
    Advance Thanks.

    Iam afraid you might run into synchronization issues with it. You are trying to get/set value of property of a sku repository item that is shared across various profiles.
    Say one profile A called setPropertyValue("propertyName", value).Now another profile B accesses
    getPropertyValue() {
    super.getPropertyValue() // Chance of getting value set by Profile A.
    // Perform logic
    There is a chance that profile B getting the value set by Profile A and hence inconsistency.
    How about doing this way??
    Create PropertyDescriptor in Profile (i.e user item descriptor), pass the attribute CustomCatalogTools in userProfile.xml to that property.
    <attribute name="catalogTools" value="atg.commerce.catalog.CustomCatalogTools"/>
    getPropertyValue()
    //You have Profile item descriptor and also storeId property value.
    // Use CustomCatalogTools.findSku();
    // Use storeId, profile repository item, sku repository item to perform the logic
    Here user itemdescriptor getPropertyValue/setPropertyValue is always called by same profile and there is consistency.
    -karthik

  • How to execute a jsp instruction from a java class?

    How to execute a jsp instruction from a java class?
    Any help please.
    Thank's

    I'll detail my problem:
    Supposing that I have a jsp file called: start.jsp
    In the start.jsp I instanciated an object called global from the class Global ( for example ).
    Then, I called a custom taglib:
    <ix:mytag/>
    In the suitable tld file: the mytag is defined:
    <tag>
    <tag class>Tag1<.....
    The java file Tag1 has method:
    doStartTag(){
    // here is the problem
    global.doSomeFunctions();
    Okay, the problem is that the object gobal is not defined in the class Tag1. what to do?
    I think that I have to pass the object global as a parameter to the class Tag1. How to do that?
    Actually, the problem was to insert the follwoing in the doStartTag method:
    doStartTag(){
    pageContext.getOut().print("<%= hello world %>");
    The output is <%= hello world %> not hello world.
    Okay, the new problem is how to pass an object as a parameter to a class called from a tld file.
    Any help please.
    Thank's too much

  • Help! How to read a .txt file into a Java class and make 2D array?

    Hi guys,
    Im a newbie with arrays, just started really using them.. please bear with me if I don't seem to understand much..
    I have a .txt file that contains either a square or rectangle (random width and length).. How can I read each line into a Java class into a 2D array with rows and columns?

    Example :
    import javax.swing.*;
    import java.util.ArrayList;
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.File;
    public class ReadInto2DArrayExample {
        public static void main(String[] args) {
            ArrayList array = new ArrayList();
            char [][] twoDimesionArray = null;
            try
                JFileChooser fileChooser = new JFileChooser();
                if (fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)
                    File file = fileChooser.getSelectedFile();
                    BufferedReader reader = new BufferedReader(new FileReader(file));
                    String data;
                    //Read from file
                    while ((data = reader.readLine()) != null)
                        //Convert data to char array and add into array
                        array.add(data.toCharArray());
                    reader.close();
                    //Creating a 2D char array base on the array size
                    twoDimesionArray = new char [array.size()][];
                    //Convert array from ArrayList to 2D array
                    for (int i = 0; i < array.size(); i++)
                        twoDimesionArray[i] = (char [])array.get(i);
                    //Test the 2D Array
                    for (int y = 0; y < twoDimesionArray.length; y++)
                        char [] temp = twoDimesionArray[y];
                        for (int x = 0; x < temp.length; x ++ )
                            System.out.print(temp[x]);
                        System.out.println("");
            catch (Exception ex)
                ex.printStackTrace();
    }

  • How can i have a refrence of a java class object instance in my c++ project

    Hi!
    How can i have a refrence of a java class object instance in my c++ project. Is there a way?

    hahaxia wrote:
    The second question is the big one. The first question is half of the problem of "c++ to java" invocation and access. But the other half which is "java to c++ " invocation and access is still not solved. jni only provide the "java to c++ " DLL invocation Wrong,
    Using JNI your java classes can have methods implemented in C/C++.
    Using JNI you can call java classes.
    There is no other possible interaction between C++ and java, so it does it all.

  • How to get Portal user from a standalone Java application

    Hi,
    I have a standalone Java application from where I need to fetch the Portal User Information like userid and email id.
    I am using the below line of code
    iUser = UMFactory.getUserFactory().getUserByLogonID("e017939");
    I have included the jar file com.sap.security.api , But it was giving me the below exception
    java.lang.NoClassDefFoundError: com/sap/tc/logging/Location
         at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:55)
         at com.am.wcas.java.mailscheduler.kmaccess.FetchDataFromKM.getiUser(FetchDataFromKM.java:29)
         at com.am.ScheduleEmails.main(ScheduleEmails.java:89)
    and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
    Then I went throught he SDN threads and they asked me to include the
    logging.jar and com.sap.security.perm.api .
    I Included them, then also, it is giving me Exception
    java.lang.NoClassDefFoundError: com/sap/engine/lib/logging/LoggingHelper
         at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:56)
         at com.am.FetchKMData.main(FetchKMData.java:30)
    Exception in thread "main"
    and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
    Kindly let me know if it is possible to access the User info using UMFactory in a standalone Java application. If yes kindly let me know where i am going wrong.
    Regards,
    Shilpa B.V

    Hi Shilpa,
    1. Check that you have added com.sap.security.api within the Your Project>Libraries folder (under navigation tab) and also added jars in the build path of the Your Project under project>properties>Build Path.
    2. In case you have a DC instead of Web Dynpro Project then you have to add the com.sap.security.api under Your DC>Used DCs and have compile time and runtime dependency added.
    Here java.lang.NoClassDefFoundError is caused basically due to only build time dependency added and reference to the jar missing at runtime. Rest the code to retrieve the current user id using UME API and getUserByLogOnID("....") method with/without portal environment would not be an issue at all.
    Regards,
    Tushar SInha

  • How to represent XML inline tags in a Java class

    Dear all,
    I am currently dealing with the issue of how to transform an XML document into a Java representation. As far as the strucural elements are concerned, I'd represent them each one of them as a Java class. However, the XML structure also allows for inline tags, i.e. elements which specify formatting information for the text. I am looking for good ideas for how to best represent these in my Java class(es).
    Let's use an example. Suppose I have something like this:
    <root>
       <structure>A piece of text</structure>
       <moreStructure>A piece of <b>bold</b> text</moreStructure>
       <finalStructure>A piece of <inlineTag att="value"> more text!</inlineTag>   </finalStructure>
    </root>I this case I would build four classes for the strucural elements. But how do I represent <b> and <inlineTag>? In my XML documents I have several such inline tags, each of which may also have a bunch of attributes. I am sure this has been solved cleverly before. Any help greatly appreciated.
    Best regards,
    N.

    The XML term for "containing tags and text" is "mixed content". And XML designers generally don't care much for mixed content. You're finding out one of the reasons for that right now. They aren't elegant or clever, just inconvenient.
    However sometimes you have to deal with ugly structures. This is one of them. I would represent mixed content as a list, just as you already thought of. The elements in this list would be either text or elements. So in this example:<moreStructure>A piece of <b>bold</b> text</moreStructure>you would have three entries:
    1. Text "A piece of "
    2. A <b> element
    3. Text " text"
    And when retrieving from that list you would have to use "instanceof" to see if you had a String or an element of some kind.
    And if "standalone tags" versus "paired tags" is a complication, then you're looking at it wrong. XML doesn't care much about tags. Tags only exist to delimit an element, and you should be looking at elements.
    I'm guessing at your non-standard terminology here: a "standalone tag" is an empty element like
    , right? And "paired tags" means a non-empty element like <this>that</this>? They're all elements. The first is a "br" element and the second is a "this" element.

  • How to run a Java class in JDeveloper - with Input parameters

    Folks,
    I need to run Forms 10g trace and do not have access to the Dos command line (no Programs-ACcessories-Comand prompt). I am allowed to run Batch files though.
    So really I need to run class "oracle.forms.diagnostics.Xlate", but need to give Input Parameter to this class. I know to load JDeveloper and open this class, but when I execute it it gives me the following error.
    My question is HOw do I input the File name to this Class when I execute it from JDeveloper.
    ERROR: You must specify an input datafile
    Exception in thread main
    java.lang.NoClassDefFoundError: oracle/forms/registry/MessageManager
         at oracle.forms.diagnostics.Xlate.printUsage(Unknown Source)
         at oracle.forms.diagnostics.Xlate.readArgs(Unknown Source)
         at oracle.forms.diagnostics.Xlate.<init>(Unknown Source)
         at oracle.forms.diagnostics.Xlate.main(Unknown Source)
    Process exited with exit code 1.

    To specify program arguments
    1. Select Tools>Project Properties.
    2. Select Run/Debug.
    3 Select the Default Configuration and select Edit.
    4. Specify the program arguments in the Program Arguments field.

  • How to Run a .sql file from simple java class

    How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
    The queries may have different delimiters,queries independant of each other.
    I am able to do with Specific De-limiter.But I need in such a way that there should not be any
    Constraints. Since My .sql may Contain different De-limiters.
    If any one can Suggest Some Solution.
    It will be Great Help.
    regards
    Anil

    Check out ibatis script runner, it' a third party library but quite handy for running sql files...
    m

  • How to used a JCR Data Control in Java class?

    Hi,
    I created a JCR Data Control to my UCM to obtain a treeTable with the datas. But it's impossible to create a treeTable like i want to.
    So I know how to create a treeModel to obtain the treeTable I want.
    Is there a way to used the getItems method of the dataControl in a Java Class?
    I tried this :
    BindingContext bc = (BindingContext)JSFUtils.resolveExpression("#{data}");
    DCDataControl dc = bc.findDataControl("UcmDC");
    But dc is null.
    There are some xml files (UcmDC.xml or getItems_return.xml). Is it a way to resolve my problem. And if so, how do I use?
    Best regards,
    Thomas

    please refer metalink id(305710.1)

Maybe you are looking for

  • How Do I Get Laptops (Mac+PC) to Share Data & Printer With "Main" Desktop?

    My daughters are both home from school for the summer. How do I set it up so we they can use the wifi to share data and use the common printer? My main computer is an iMac desktop -- running Tiger. I have the Airport Extreme. My printer is plugged to

  • Automatically mount USB 3.0 WD External HDD with iMac 24-inch mid-2007

    I am using a 2TB Western Digital (WD) My Book Essential external Hard Disk Drive for my iMac 24-inch mid-2007 to use it as a Time Machine backup disk. This HDD only comes with a USB 3.0 connection.  Function-wise, it works with the iMac and Time mach

  • How do I delay sending an email in Mac OS X Lion Mountain?

    I am VERY new to using a Mac and want to do what I can do in Outlook. However I cannot find an option to delay the sending of an email. Can anyone help? I have spent about 30 mins googling this and I read alot about scripts? Am I meant to write a pro

  • Do headphones need to be plugged in for FM tuner to get signal ?

    Hi, I was thinking of using a 6th gen iPod Nano for it's Fm tuner function. However, would like to use a Fiio L10 cable (30-pin to 3.5mm stereo), to get a direct line out analog signal to another amplifier. But this 30pin connector will get in the wa

  • Clearing accounts for Bank account

    I understand the concept of maintaining clearing accounts for Bank a/cs. But i dont know how to create them. Is there any spl procedure for that or is it similar to GL creation using FS00. Please guide me... Thanks in advance Choudary KV