Is it possible to execute simple class

Sir,
Is it possible to execute a simple program written in java in
jdeveloper. If yes please let me know how to that.
I creted a class using class wizard and added the following
statement;
System.out.println("testing");
I able to compile the program without error, but how to execute
it.
raghu
null

Hi Jun Wu,
Because without deploying, it doesn't allow me check how my java webdynpro application works!!
I  need to execute my java web dynpro application and I dont have any access to SDM pins/passwords.
Please share your valuable thoughts on the same.
regards,
Ajeeth Kumar S

Similar Messages

  • Can you execute a class file without invoking the command line java command

    I am running java on a Windows XP equipped machine, and I am wondering if it is possible to execute a class file by double clicking the file icon, or can it only be done via command line. So far I have been unsuccessful in my attempts - I tried associating the class file with the java executable in my JRE directory, but that didn't work.
    Many thanks,
    -Stile

    nope, can't be done, by design... microsoft recognised java as threat to the empire very early on in the peace.... but you can write a batch file to execute myprogram.class called myprogram.bat and stick it in your PATH.
    keith.

  • Having trouble using a simple class..New to AS3

    Hello Everyone,
    I am new to AS3 but not to AS2. I have written a simple class
    and when I import it, I don't see the object that should be created
    upon calling the constructor. Can you guys tell me where am I going
    wrong. And I am very puzzled about 'document class'. Yes, I have
    google numerous threads on "document class" but still very shaky on
    this matter. Here is my simple class which should place a button
    object on the stage when I create a new object of this class.
    Once I have created the BTN class, I have made sure that I
    have button component in my library, I then instantiate the object
    by creating a new CS3 file and importing my class:
    import com.learning.as3.*;
    var b:BTN = new BTN();
    When I test the movie, I get the following errors:
    1172: Definition com.learning.as3 could not be found.
    1046: Type was not found or was not a compile-time constant:
    BTN.
    1180: Call to a possibly undefined method BTN.
    Any help would highly be appreciated.
    Thanks you.

    Hello Ned,
    Yes, I have made sure that my directory structure exist as it
    should be and yet I still get the errors.
    Thanks a lot.

  • How to execute a class wich is not in the classpath

    Sometime the server can't be shutdown and, if You add some new classes to Your system there's a classpath problem : in the classpath OC4J doesn't see new classes
    How can we solve that problem ?
    Is it possible to execute something wich is not in the classpath ?
    Can the classpath be changed at runtime ?
    TIA
    Tullio

    Please look at the following paper http://otn.oracle.com/tech/java/oc4j/pdf/ClassLoadingInOC4J_WP.pdf
    tha describes how does classloading work in OC4J.
    You can deploy application using opn expanded directory structure if you are using OC4J standalone.
    Also you donot have to restart the server when classes are changed, you have to touch the application.xml for your application or web.xml for Web module to redeploy the apps.
    regards
    debu

  • Unable to execute java class.

    HI !
    I have got a very weird problem .I have wrritten a simple java program Hello world using Weblogic workshop.As required I'm saving this file in the package folder and executing it .I have set the home directories properly .My code is :
    package java1;
    public class hello
    public static void main(String[] args)
    System.out.println("Hello World");
    After I compile I get the foolowing in the o/p window :
    Trying to attach to 3218...
    Starting process in C:\bea\myprojects
    C:\bea\jdk141_02\bin\javaw.exe -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=3218,suspend=y,server=y -classpath myprojects.proj1.java1.hello
    Usage: javaw [-options] class [args...]
    (to execute a class)
    or javaw -jar [-options] jarfile [args...]
    (to execute a jar file)
    where options include:
    -client     to select the "client" VM
    -server     to select the "server" VM
    -hotspot     is a synonym for the "client" VM [deprecated]
    The default VM is client.
    -cp -classpath <directories and zip/jar files separated by ;>
    set search path for application classes and resources
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -showversion print product version and continue
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    I dont know what to do ? Do I have to set any paths or any thing ? It is not required to set the class path here.
    Please Help.
    Thanks in advance.

    try to compile your programm from command prompt
    change dir to hello.java directory
    to compile programm type:
    javac hello.java
    if it will compile successfully run it by typing
    java hello
    if it will not be helpfull uninstall JDK 1.4 and instal JDK again. I'd recomend JDK 1.5.

  • Can i give a process name of executing java class

    hi all,
    what i need is when i execute the class file using java at the command prompt i want to create a separate process of that class. that means when i execute this class i want 2 processes running one is "java" and the other is "The Class To be executed".
    is it possible????
    actually my requirement is that i want only one instance of my class can run at a time.
    please help me
    thanks
    bye

    hi
    actually i can not use the file lock because my application is going to run on Solaris machine and since its a mutiuser platform and every user has a limited access to his data.and any user can run my application so the problem is where one user will write into a file so that other user can also read from the same file.
    can i do it other way using native methods if yes can u elaborate please
    thanks
    bye

  • Is it possible to execute .bat file located in package ?

    Hi,
    in my application i execute a print.bat file using Runtime.exec(), i'd like to place this .bat in package, let's say com.me.testpackage. How is it possible to execute the batch file from that location?
    thanks

    jschell wrote:
    sabre150 wrote:
    jschell wrote:
    >Simple 'for' loops seem to work OK but still more research needed.
    There is escaping in the for loops which is necessary in a bat file and not needed at the command line.
    It seem to be that any command spanning more than one line fails. Fail? The example that gave shouldn't fail. It should simply run both echos.As I understand it, the command sequence
    @echo off
    goto XXX
    echo out
    :XXX
    echo last
    should just output 'last' and not 'out so if it prints both 'out' and 'last' then in my view it 'fails'. Am I missing something?
    >
    >>
    Makes me even more pleased that I work mainly with Linux.Looking up syntax - what about getopts (bourne and korn)? You can also create 'functions', which can be defined later (if I recall correctly) in the script and called multiple times. I don't know how that would work streaming it in.I don't know about consequences of the streaming approach forward definitions in 'bourne' and 'korn' though I was not aware that 'bourne' allowed them. For 'bash' where forward definitions do not seem to be allowed (could I be mistaken in this?) then using        Process process = Runtime.getRuntime().exec("bash", null, new File(System.getProperty("user.home")));the following very simple 'bash' script (which contains loops, if statements and functions but no goto or forward definitions) can be executed without problems - # Simple bash script
    function sayHello {
        echo "Hello" $1
    sayHello "World" ;
    for i in $( ls /tmp ); do
        echo file - $i
    done
    for i in `seq 1 10`;
    do
        echo "seq" $i
    done
    i=0
    while [  $i -lt 6 ]; do
    if [ $i -eq 4 ]; then
        echo "then" $i
    else
        echo "else" $i
    fi
        let i=i+1
    done
    i=12
    until [  $i -lt 10 ]; do
    echo "until" $i
    let i-=1
    doneIn the past, I have also published examples of how to run Perl scripts using the same basic approach. The heart of the examples is         final String perlScript = "#!/bin/perl\n" +
                "print \"PID $$\\n\";\n" +
                "print \"UID $<\\n\";\n" +
                "print \"EUID $>\\n\";\n" +
                "print \"GID $(\\n\";\n" +
                "print \"\\nProcessing the command line arguments\\n\";\n" +
                "foreach (@ARGV) {\n" +
                "    $n = factorial($_);\n" +
                "    print \"    $_! = $n\\n\";\n" +
                "}\n" +
                "print \"\\n\".'@INC'.\"\\n\";\n" +
                "foreach (@INC) {\n" +
                "    print \"    $_\\n\";\n" +
                "}\n" +
                "print \"\\n\".'%ENV'.\"\\n\";\n" +
                "foreach (keys %ENV) {\n" +
                "    print \"    $_==$ENV{$_}\\n\";\n" +
                "}\n" +
                "$x = theAnswerToTheUltimateQuestion();\n" +
                "print \"\\nThe answer to the ultimate question is ... '$x'\\n\";\n" +
                "sub theAnswerToTheUltimateQuestion()\n" +
                "{\n" +
                "    return 3*2*7;\n" +
                "}\n" +
                "sub factorial()\n" +
                "{\n" +
                "    my ($n) = @_;\n" +
                "    return ($n > 1) ? $n * factorial($n-1) : 1;\n" +
                "}\n";
            System.out.println(perlScript);
             * The perl source can be from any InputStream. Here I use a
             * ByteArrayInputStream just as a demonstration.
            final InputStream perlSource = new ByteArrayInputStream(perlScript.getBytes());
             * The '-' indicates that the Perl script comes from stdin. The "a","b","c" etc
             * are the command line arguments passed to the Perl script.
            final String[] command =
                "perl", "-", "5", "6", "7", "8", "9", "10"
            final Process process = Runtime.getRuntime().exec(command);piping the 'perlSource' stream to the process stdin.
    This runs as expected on both Linux (FC9 and Ubuntu 8.04) and on Windows using Active Perl.
    Please don't take my use of a String to hold the Perl script to mean that I in any way endorse this approach - I just wanted a simple means to create a self-contained example.
    >
    And the c shell has a goto also.One day I might find some time and investigate 'c' shell goto in this context - since I have not used csh for at least 8 years I am very rusty.
    I can't say that the 'streaming' approach will work with all Linux shells but I can say that on Linux I have had no problem with Perl and Bash. If anyone needs to use the 'streaming' approach with another shell then it takes just a few minutes to setup a test harness. If any problems are found then people can always resort to the 'Plan B' approach.
    I am still pleased I work mainly with Linux and Unix.

  • Executing a .class file

    Hi all,
    Can anyone help me about how to execute a ".class" file from within a java Program. Thanks in advance
    Regards,
    Deepan

    i have a class file in "c:\sample.class" i want to
    run this class file from my program. How to achieve
    this? i am a newbie kindly bear with me..the reason you're not getting a straightforward answer is that this is the sort of thing you can find out for yourself in the tutorials, or from your teacher, or a book, or a simple google query. the forum isn't the place for complete novices to learn from, that would be a waste of effort on everybody's part
    get reading!

  • Executing another class from another package with a click of a button

    package language;
    textfield_4 = new JTextField();
    getContentPane().add(textfield_4);
    button_10 = new JButton("Open");
        getContentPane().add(button_10);
        button_10.addActionListener(new java.awt.event.ActionListener()
          public void actionPerformed(ActionEvent e)
            String cmd = "notepad.exe";
            String path = textfield_4.getText();
            try
              Runtime.getRuntime().exec(cmd + " \"" + path + "\"");
            catch (IOException ex)
              ex.printStackTrace();
        button_12 = new JButton("Run");
        getContentPane().add(button_12);From the codes above, what i intended to do is when clicking the "Run" button, it will pass the values from textfield_4 to another class in another package thus, executing the class with the value of textfield_4. What are the steps to do that? If possible, please insert sample codes. Thank you.

    import  anyPackage.AnotherClass;
    button_12.addActionListener(new ActionListener() {
      AnotherClass ac = new AnotherClass();
      ac.execute(textfield_4.getText());
    });Is that what you wanted?

  • Is it possible to call a class method using pattern in ABAP editor.

    Hi,
         Is it possible to call a class method using pattern in ABAP editor.
    Thank U for Ur time.
    Cheers,
    Sam

    Yes,
    Click patterns.
    Then choose Abap objects patterns.
    Click on the Tick
    It will give a new screen
    Here Give the name of the class first.
    Then the object (instance of the calss)
    And finally the method ..
    it will give you the pattern
    Hope this helps.

  • Is it possible to call a class in a jar file from JNI environment?

    Hi
    Is it possible to call a class in a jar file from JNI environment?
    Thanks in advance.

    Could you explain a bit more what you are trying to do? (In other words, your question is vague.)
    o If your main program is written in C, you can use JNI to start a JVM, load classes from the jar of your choice, and call constructors and methods of the objects defined in the jar.
    o If your main program is java, and has been laoded from a jar, a JNI routine can call back into java to use the constructors and methods of classes defined in the jar(s).

  • Difference between narrow() method usage and simple class cast for EJB

    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?
    P.S. I'm working with WL 6.1 sp2
    Any help would be appreciated.
    Thanks in advance,
    Orly

    [email protected] (Orly) writes:
    Hi,
    I have a very simple question:
    what is the difference between PortableRemoteObject.narrow(fromObj,
    toClass) method usage and simple class cast for EJB.
    For example,
    1)
    EJBObject ejbObj;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)PortableRemoteObject.narrow(ejbObj,ABean.class);
    OR
    2)
    EJBObject bean;
    // somewhere in the code the home.create() called for bean ...
    ABean a = (ABean)ejbObj;
    Which one is better?(1) is mandated by the spec. It is required because CORBA systems may
    not have sufficient type information available to do a simple case.
    P.S. I'm working with WL 6.1 sp2 You should always use PRO.narrow()
    andy

  • Using Adobe Acrobat - Is it possible to execute JavaScript to report to LMS to track pdf was viewed?

    Question:  Using Adobe Acrobat - Is it possible to execute JavaScript to report to LMS to track pdf was viewed?
    What I would like to do is to create a pdf with an Acknowledgement button that when click will report (via JavaScript) to the LMS (Learning Management System) that the end user viewed/acknowledged the pdf.
    Can this be down with JavaScript in this fashion?

    Thanks, (My fault, as I should have specified this.) Due to legacy reasons I need to use ie, and so I can't use the PrintPdf firefox plugin. So from reading the rest of that thread, the best method does seem to be to get hold of a copy of acrobat, and add a Print() script in each file, and open it in a new tab.
    At least it gives me somethigin to try anyway :-)

  • Is it possible to unload a class?

    Suppose I take a classloader and load a class. Then I set my classloader to null and get rid of any objects of it that I've instantiated. Can that class be garbage collected?
    I'm thinking that it probably isn't possible. Even if you can get rid of all references to the class, what if a thread is running a static method of that class? But then again I suppose the stack trace would then have a reference so it can't be garbage collected. Was also thinking about what if a thread is just about to call it, but I guess you could just pop a classNotFoundException. So maybe it is possible... Can anyone comment?

    Well... I'm pretty sure it's possible to unload a class since it's possible to replace them. My IDE (IntelliJ) is capable of recognizing a change in your class file (as a result of compilation while the program is running, for example) and inserting the new class into the application if you want. This is very handy for working on web applications wherein the server takes a while to reload the application.
    So if you can reload the class, you can probably unload it, yes?

  • Is it possible to override super class constructor?

    Is it possible to override super class constructor form subclass?

    However, you can achieve do something that looks similar to overriding.
    class Parent {
      Parent(int i, String s) {
        // do stuff
    class Child extends Parent {
      Child(int i, String s) {
        super(i, s);
        // do Child stuff here
    new Parent(1, "abc");
    new Child(2, "xyz");Although that's not overriding, it sort of looks similar. Is this what you were talking about?

Maybe you are looking for