How to calling JVM in java code

Hello!
I continued my homework -- a java IDE written in java. I've asked how to compile the java code in my IDE here. Thanks to Franck_Lefevre, he showed me this:
import com.sun.tools.javac.Main;
public static boolean compileSource(String filename) {
String[] javac_args = { filename };
int result = Main.compile(javac_args);
return (result == 0);
now the problem is how to RUN the .class file on the JVM. Is there a method corresponding to this, ie also using java tools? or some better ways? I've tried a few ones but they don't work well.
I really appreciate you who helped me so much.

Planetar, remember to read the API docs for the
complete method signature for Class.getMethod.Good point, take my code example as just a rough guide of what to look at in the API docs. Namly,Class, ClassLoader and Method.

Similar Messages

  • Do you know how to call RDF with java code?

    Say me a tip!
    Environment:
    Linux, Reports 6i,java beans, jsp
    My mission is to run a report with java code.
    But I don't know how to.
    Basic flow is :
    On web browser, call jsp a program and
    that jsp call a java module,
    and the java module call a reports RDF with parameters
    I don't need reponse message from rwcgi60 or rwrun60.

    hello,
    the easiest way is to use the regular HTTP request to either the servlet or the CGI to run a report request from within a java-class.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                       

  • How to call codec in java code

    i want to call a jmf codec for video compression form direct capture device, i dont know how to call codecs of Jmf i am using jffmpeg how to implement it can any one please let meknow

    Lot of examples are given in the below link
    http://www.oracle.com/technology/sample_code/tech/java/jsp/oracle9ijsp.html

  • How to call xml from java

    Hi
    I want to use xml for updating files in an existing jar . so i want to call xml from java code and then come back to java code and do the remaining work in java code, pl guide me how to do this . what APIs are helpful for this regard
    Thanks

    You can't update files in a jar. Even if you could, you wouldn't use XML for that. You don't call XML. XML is not a programming language. So, basically your entire question is misguided.

  • How to Call Livelink Archive Java Viewer(IXOS-JavaViewer Applet )

    Hi,
    I want you to teach,How to call Livelink Archive Java Viewer(IXOS-JavaViewer Applet)
    I want to call it in the following images.
    When the button is pushed, I want to call Livelink Archive Java Viewer.
    The method was not able to be taught though it inquired of the help desk of
    IXOS.
    Please teach me!
    Reagard

    Hi Tomohiro,
    Is this issue being resolved? which version of ixos server and viewer are you using?
    regards,
    Jess

  • How to call procedure in Java from SQL Server Database

    Hello Every Body
    i Have Question about
    How to call procedure in Java from SQL Server Database
    Thanks

    Hi,
    have you tried a Google search? I just gave it a 3 second try and already found: http://stackoverflow.com/questions/6113674/how-do-i-execute-a-ms-sql-server-stored-procedure-in-java-jsp-returning-table-d
    Frank

  • MDM Web Service Generator - How to Call WS in Java?

    Hi there,
    I have generated a web service by navigating to http://<server>:<port>/mdm/wsgenerator - The web service is succesfully generated and deployed. I can easily test the web service using the WS Navigator (http://<server>:<port>/wsnavigator).
    I am now trying to use NWDS7.2 to create a wrapper web service, and need to call my generated MDM WS using Java code. I have created a CAF project, and imported the MDM web service using the WSDL. I have created an application service and no matter what I try, I cannot get the MDM web service to instantiate.
    Is there anyone that has done this before? What method should be used?
    All I need to know is how to create an instance of the generated MDM web service - There is no obvious constructor to use. See my code below, but this creates an exception at runtime for "IndexOutOfBoundsException". Note that the web service I generated is called "MdmWfProjectUpdate"
    service = new MdmWfProjectUpdateViDefaultService(
                                  new java.net.URL(
                                              "http://<server>:<port>/MdmWfProjectUpdate/HTTPBasic?wsdl"),
                                  new javax.xml.namespace.QName(
                                              "urn:MdmWfProjectUpdateWsd/HTTPNone", "MdmWfProjectUpdateVi_DefaultService"));
    I can call other web services without a problem in my code, so it is quite confusing that I cannot get this to work...
    Any help will be appreciated!

    Hi david ,
    When u imported  this webservice,there will be lot of classes generated .In these classes some are executable classes.Like if your webservice contain some operations like update,create,delete.
    then for each operation tere will be one executable class  generated.
    this class  must have some function like execute or invoke.You have to call this function in order to get the results.
    Just check whether is there any such class generated or not.
    Kindly revert back with your results.
    Thanks,
    sudhanshu

  • How to call jsp in PLSQL code (to upload a file in IFS)

    Hello,
    We develop our PORTAL (9.0.2) with PL/SQL way.
    We want to make a form to upload file in IFS.
    We create a form like that :
    htp.formOpen(cmethod =>'post',
         cenctype => 'multipart/form-data',
         curl => '/pls/ptlcollab/ptlcollab.GestionDoc_screenbuilder.manipTableIFS',
         cattributes => 'name="ifs"') ;
    htp.TableData(htf.FORMFILE(cname=>'file', cattributes => 'size="25"')) ;
    The manipTableIFS procedure calls a loaded java procedure which called a servlet which work with IFS.
    BUT, modplsql seems to want we directly upload the doc in a table but we want to upload the doc in iFS !!!
    So, the solutiuon seems to call a jsp (or a servlet directly from our plsql code).
    BUT, how could I do that ???
    Any help would be greatly appreciated.
    Regards.
    Luc.

    Something along these lines ought to do what you want:
    <html>
    <body>
    <form name='foobar' action='foobar.jsp'>
    <script language='Javascript'>
    function askim() {
      if (confirm('Is you sure?')) {
        document.foobar.submit();
      } else return false;
    </script>
    <input type='button' value='Submit' onClick='askim()'>
    </form>
    </body>
    </html>
    Your mileage may vary.
    But the idea here is that the Javascript merely submits the form if the user clicks "OK" on the confirmation pop-up. Otherwise, nothing happens. The form is submitted to a JSP file which accepts the request, does something (such as call your Java class), then prints out some HTML in response.

  • How to run report from java code

    I am a begginner in Oracle Reports. We have no AS installed, so we run reports either from Reports Builder or by calling rwrun. I would like to know how to embed report calling into java code , let's say into simple swing application. Some example code would be welcomed. Thanks.

    Hello,
    You can find examples in :
    http://download-uk.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_webservice.htm
    Oracle® Application Server Reports Services Publishing Reports to the Web
    10g Release 2 (10.1.2)
    B14048-02
    14 Using the Oracle Reports Web Service
    Regards

  • How to invoke javafx from java code

    hi all,
    i'm trying to invoke my .fx class from java class, but getting exception.
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (The system cannot find the path specified)
    javax.script.ScriptException: compilation failed
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.parse(JavaFXScriptEngineImpl.java:255)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:145)
    at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:136)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
    at myclockproject.Main2.main(Main2.java:34)
    I read in article http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_and_java/ about including javafxc.jar in classpath .. could some one tell me what classpath he meant, i have included it in my environment variable and also project libraries .. still getting error :(

    coolsayan.2009 wrote:
    thanx.is communication api required?but is the communication api available for windows?its available for linux and sparc??Are you referring to the COMM API that is referenced in the first link when you google - the one entitled "How to Send SMS using Java Program (full code sample included)"? If so, Here: [http://java.sun.com/products/javacomm/|http://java.sun.com/products/javacomm/]
    what to do in serverside?is any change required in web.xml or any jndi setup in serverside if i call the java class from a jsp page?I don't know, are you planning on making your class available through JNDI?

  • Calling jvm from c++ code fails the secnd time

    Hi all,
    i have a dll which calls java code thru jni.
    for the first time i am able to successfully call the jvm.
    when i execute 2nd time jvm crashes
    though i destroy the jvm for the first time.
    looks like it doesnot load all native method.
    below i have listed the verbose of jvm loading secnd time.
    please advice me if i need to use any technique in loading the jvm.
    thanks in advance
    [Dynamic-linking native method java.lang.Float.intBitsToFloat ... JNI]
    [Dynamic-linking native method java.lang.Double.longBitsToDouble ... JNI]
    [Dynamic-linking native method java.lang.Float.floatToIntBits ... JNI]
    [Dynamic-linking native method java.lang.Double.doubleToLongBits ... JNI]
    [Dynamic-linking native method java.lang.Object.registerNatives ... JNI]
    [Registering JNI native method java.lang.Object.hashCode]
    [Registering JNI native method java.lang.Object.wait]
    [Registering JNI native method java.lang.Object.notify]
    [Registering JNI native method java.lang.Object.notifyAll]
    [Registering JNI native method java.lang.Object.clone]
    [Dynamic-linking native method java.lang.Throwable.fillInStackTrace ... JNI]
    # HotSpot Virtual Machine Error, Internal Error
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Error ID: 455843455054494F4E530E43505000DE
    # Problematic Thread: prio=139238232 tid=0x84c9b58 nid=0x0 runnable
    #

    Hallo,
    if I understand your problem correctly, you are creating the JVM, doing something, calling DestroyJavaVM() and then creating the JVM once more. You cannot do that! See: http://java.sun.com/j2se/1.3/docs/guide/jni/jni-12.html#DestroyJavaVM . The solution is just to create the JVM once, when you first need it. You can then reuse it as offen as you want.

  • How to call another directory java program?

    Hi All,
    For Example:
    My program is here in two directories.Let Think that directory names like A and B.
    Let Program names like Aprog(A directory) and Bprog(B directory).
    I want to call Aprog to Bprog method.
    How to call?
    Plz., help me ASAP.
    --Mohan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    My program is here in two directories.Let
    Think that directory names like A and B.
    It's more complicated than that. A java program consists of multiple .class files. In general you have one or more "trees" of directories of .class files, where the structure of the tree reflects the package structure. So a the class file for "org.dingbat.Thingy" is <basedir>/org/dingbat/Thingy.class where <basedir> is some directory on the class path.
    So referencing one class from another in different directories requires that the source provides the "fully qualified name" of the class (usually on an import) and making sure that, if it's in a different class file tree, both base directories are on the class path.

  • How to call webservice using java client

    Hi,
    I am new to webservice related stuff.Can any body help me.
    How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
    Thanks
    venuj

    user10394151 wrote:
    Hi,
    I am new to webservice related stuff.Can any body help me.
    How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
    Thanks
    venujTry this simple webservice client.
    You will need apache-axis.jar in your classpath. The following client is apache axis based. A similiar client can be built also using the JAX-WS only[without apache-axis.jar].
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.namespace.QName;
    public class WEBSERVICE_CLIENT{
    public static void main(String [] args) {
    try {
    String endpoint ="<YOUR WS ENDPOINT>";
            Service  service = new Service();
            Call     call    = (Call) service.createCall();
            // YOU CAN SET VARIOUS PROPERTIES IN THE "CALL" OBJECT...LIKE
            // USERNAME,PASSWORD,PROPERTIES OF HTTP HEADER. SEE "CALL" OBJECT'S API FOR MORE PROPERTIES.
            call.setTargetEndpointAddress( new java.net.URL(endpoint) );
            call.setOperationName(new QName("<YOUR WS SERVICE NAMESPACE>", "<WS SERVICE TO BE INVOKED>"));
            String msg = (String) call.invoke( new Object[] { "data" } );
            System.out.println("RETURNED MESSAGE : "+msg);
          } catch (Exception e) {
            System.err.println(e.toString());
    }

  • How to call webservice from Java application

    Hi XI gurus
    Pls let me know how to call a webservice from Java application.
    I wanted to build synchronous interface from Java Application to SAP using SAP XI
    For example, i need to create Material master from Java application and the return message from SAP, should be seen in Java application
    Regards
    MD

    Hi,
    If your  JAVA Application is Web based application, you can expose it as Webservice.
    JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
    So we can Use SOAP Adapter or HTTP in XI..
    If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
    If you are dealing with the Webservice and SAP Applications means check this
    Walkthrough - SOAP  XI  RFC/BAPI
    REgards
    Seshagiri

  • How to call webservices function - java importer 6i -Duncan?

    I've imported methods of a webservice from salcentral following instructions in otn.
    Now I need to figure out how to call the resulting function in forms
    Here is the function, the pl/sql error is wrong number or type of arguments
    Anyone done this and know how to get the function signature correct?
    I want to call checkemail
    PACKAGE BODY MXCheckerStub IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    cls ORA_JAVA.JCLASS;
    fid ORA_JAVA.JFIELD;
    mid ORA_JAVA.JMETHOD;
    args JNI.ARGLIST;
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT IS
    BEGIN
    cls := JNI.GET_CLASS('mypackage/MXCheckerStub');
    mid := JNI.GET_METHOD(FALSE, cls, '<init>', '()V');
    args := NULL;
    RETURN (JNI.NEW_OBJECT(cls, mid, args));
    END;
    -- Method: CheckEmail (Lorg/w3c/dom/Element;)Ljava/util/Vector;
    FUNCTION CheckEmail(
    obj ORA_JAVA.JOBJECT,
    a0 ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
    BEGIN
    cls := JNI.GET_CLASS('mypackage/MXCheckerStub');
    mid := JNI.GET_METHOD(FALSE, cls, 'CheckEmail', '(Lorg/w3c/dom/Element;)Ljava/util/Vector;');
    args := JNI.CREATE_ARG_LIST(1);
    JNI.ADD_OBJECT_ARG(args, a0, JNI.GET_CLASS('org/w3c/dom/Element'));
    RETURN JNI.CALL_OBJECT_METHOD(obj, mid, args);
    END;

    I would try to take an aproach where I'll generate a stub for the WSDL in JDeveloper, and also write a
    Java class that calls this stub and return a simple variable (String, int, or boolean).
    Then I would call this class from Forms.
    I believe this would make it easier.

Maybe you are looking for

  • What is the best way to capture off of an AVCHD Camera in final cut?

    Im kinda new to final cut pro so, please don't flame me. I was hoping to capture some extra footage on to my system through my AVCHD camcorder. And i want to know the best way to do so? Thanks for the answers.

  • Work Station

    I was trying to shrink my media browser, and I was moving my effects folder from on place to the other and doing this and that to correct my mistakes and now my whole work station is a mess.  I went to Windows-workstation-reset current work station a

  • HT1338 Burn iPhone movies to DVD

    I have an iPhone 4S and a MacBook Pro. Does anyone know how to burn iPhone movies to a DVD so it can play on my DVD player? Thx.

  • Illustrator cs6 ERROR 1

    using adobe illustrator cs6. when click double button to start program, see ERROR 1.

  • Why did Auto Add to iTunes stop working?

    I recently started using Handbrake to covert some of my DVDs/BRs to Apple TV 2 (m4v) format for my 2 year old to watch without killing my physical media.  Typically, I would covert the file, drop to the Automatically Add to iTunes folder, go in to iT