How do I start and suspend Java Application from say C++ program

I want to start a Java application via C++ and on some condition i want to suspend the same program not terminate , but suspend

Have you tried running the virtual machine from your C++ application ? You can start Java applications from your C++ application using JNI after starting the Virtual machine from within your C++ application. According to the Java documentation you can even now stop the virtual machine from within your C++ program.
I haven't looked at the 'suspend' detail but I suppose it will not be a problem to call a method via JNI to set a flag to suspend a thread etc.
There is a tutorial: 'Invoking the Java Virtual Machine' at the following URL: http://java.sun.com/docs/books/tutorial/native1.1/invoking/invo.html.
This example seems to work only for version1.1 of the JDK. For JDK1.3, version 1.2, (I am not so sure whether I fully understand Sun's version numbers for Java yet) there is some updates on the JNI for starting the VM from C++. This article is called 'JNI Enhancements'. The URL for this article is:
http://java.sun.com/j2se/1.3.0/docs/guide/jni/jni-12.html
You have to set version to: JNI_VERSION_1_2
There is only one problem. I get an error when calling JNI_CreateJavaVM from C++. I could not find any documentation that indicates how you can go about diagnosing what is causing the problem. Normally in Visual C++ you can just get the probable cause by inspecting GetLastError() or the function itself can return helpful diagnostic (error) codes.
If you manage to start the VM correctly from within Visual C++ please let me know. My email address is [email protected]
good luck
Henko

Similar Messages

  • How to retrieve start and end date values from sharepoint 2013

    Hi,
    How to retrieve start and end date values from new event form of calendar in SharePoint foundation2013
    Thanks
    Gowri Balaguru

    Hi Srini
    Yes i need to have parallel flow for both and in the cube where my reporting will be on monthly basis i need to read these 2 master data and get the required attributes ( considering last/first day of that month as per the requirement).......but i am just wondering this is common scenario....while there are so many threads written for populating 0employee from 0person......don't they have such requirement.....
    Thanks
    Tripple k

  • How to call a stand alone java application from ADF BC JSP, struts or JSF

    Hi,
    My requirement is that there are utilities or stand alone java applications that I want to call from our existing applications.
    We have two seperate applications one ADF BC Struts application we developed using JDeveloper 10.1.2 and another ADF BC JSF application we developed using JDeveloper 10.1.3.2.
    We want to integrate applications like JTwain and others to help us in scanning. The application will be placed on the same server as our application. How can I do this without loosing all the current session information.
    Please help.
    Thanks and regards,

    There are two possible solutions.
    First, if the tool or application you want to integrate, has an Java-API you can use this api and integrate the tool in your application (using one or more jars you add to the classpath).
    Second, if the tool has no java api, you can call the tool via runtime.exec(...) as a shell process. This way you open a command shell in you application and execute the tool like you do on a normal command shell.
    For tide integration and control I recommend the first approach. The second one is only for those tools which don't offer a java api.
    Timo

  • How to use " toFront() " method in java application and in which package or

    How to use " toFront() " method in java application and in which package or class having this toFront() method.if anybody know pl. send example.

    The API documentation has a link at the top of every page that says "Index". If you follow that and look for toFront(), you will find it exists in java.awt.Window and javax.swing.JInternalFrame.
    To use it in a Java application, create an object x of either of those two classes and write "x.toFront();".

  • How to start and stop Oracle Application Server from ANT

    How to start and stop Oracle Application Server and Web application from ANT
    Thanks in Advance.
    Mani

    Hi,
    You can use: startManagedWebLogic.sh, it is in your domain directory and you have to execute it in this way
    ./startManagedWebLogic.sh managedServerName http://adminServerHost:adminServerPort
    For instance, in my case I use:
    unixserv01:/webportal/domains/appServerWeb/bin>startManagedWebLogic.sh managedServ01 http://pelma3w3per01.mesaperu.next:7001
    You have to run it on the machine where the managed server was installed.
    Best regards,
    Raúl

  • How to run ear file in java application server

    i want how to run .ear file in java application server
    1. i m created ear file
    2. i m created jar file (bean,home,remote)
    3.i m created war file(in the form of jsp)
    but till now i couldnt run ear file
    how to run
    please hel me

    You must create :
    1.Jar file
    2.War file
    And then put them into an ear file
    Exemple : myapp.ear contains
    myappEJB.jar
    myappWEB.war
    META-INF/application.xml
    and application.xml looks like this :
    <application xmlns="http://java.sun.com/xml/ns/j2ee" version="1.4"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com /xml/ns/j2ee
                            http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
        <display-name>myapp</display-name>
        <description>Demo application</description>
        <module>
            <ejb>myappEJB.jar</ejb>
        </module>
        <module>
          <web>
             <web-uri>myappWAR.war</web-uri>
             <context-root>/myapp</context-root>
          </web>
        </module>
    </application>Good luck

  • How to transfer parameters to Webdynpro Java application ?

    Hello guys,
    I had developed a Webdynpro Java application "ZWD", it's URL is
    "http://jt-pldev:50000/webdynpro/dispatcher/local/ZWD_FLIGHT/ZWD".
    "ZWD" had 2 input parametere "InputField" and "InputField1" .
    Accroding to SAP Online Help  document, we can transfer parameter Webdynpro application .
    I want to transfer parameters to application "ZWD"  via URL
    "http://jt-pldev:50000/webdynpro/dispatcher/local/ZWD_FLIGHT/ZWD?InputField=Frankfurt" .
    But it failed.
    My questions:
    1. How to transfer parameter to Webdynpro Java application "ZWD" ?
    2. Does it possible that transfer input parameter to Webdynpro application and run the applicaiton via specific URL ?
    BR,
    Louis

    Hi Louis,
    You can refer to the following Bertram's article:
    [Inter-Application-Navigation in Web Dynpro|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/user-interface-technology/wd%20java/wdjava%20archive/inter-application-navigation%20in%20web%20dynpro.pdf]
    The process of accessing the Application URL parameters is explained for Target Component.
    Regards,
    Alka.

  • How do i show vbscript into java application?

    hi
    how do i show vbscript into java application? ( looks like microsoft frontpage)
    or what is interpreter of vbscript for java ?
    thank you?

    There probibly isn't one.
    vbscript and java are rather different. You are better of opening a vbscript viewer from java as a sperate program.

  • How Can I Start And Start And DebugTomcad in Jdeveloper12C

    Hi
    How Can I Start And Start And Debug Tomcad Application Server in Jdeveloper12C.

    I'm not sure if this extension will work in 12c - but you can download the code and try and upgrade it to 12c - https://blogs.oracle.com/shay/entry/tomcat_extensions_for_jdevelop_1
    You can also just add command line short-cuts to start Tomcat to the tools->External tools option in Jdeveloper.

  • How many web.xml in a java application

    Hi,
    can anyone give tell the answer for this question "How many web.xml in a java application?"

    1Why ?Because the Web container refers to only one web.xml for one web application.
    I havent heard of an application having more than 1 web.xml
    How?It reads all the definitions of servlet mappings, filters, welcome-file etc from this file itself.
    Where?From the following folder ...
    /WEB-INF
    By the way ..... the way you questioned me was amuzing ... Why? How ?Where ? Its funny :D
    I actually wanted to reply as below ..
    Why ?Why not
    How?
    Wait lemme think ....ummm... What do you mean how??
    Where ?
    Inside the web ;-)
    -Rohit

  • How to call a WD JAVA application from a WD ABAP application

    Hi experts,
    Here I have two applications with me. One has been created through WebDynpro ABAP while the other one has been created through WebDynpro JAVA. Now i have to call upon the JAVA aplication from my ABAp application. In other words in need to integrate both the applications so as to have an easy navigation in between them.
    In the whole process I need to take care that the data is not lost from both ABAP or JAVA side.
    Please help me someone knows the solution.
    Regards,
    Kaustubh Maithani

    Hi,
    Usally to run WebDynpro for Java Application, we get the Application URL.
    If you want to call this WebDynpro Java Application from Webdynpro Abap, then create UI element like Link to Action or LinktoURL and give the url as WebDynpro for Java URL.
    Regards,
    Lakshmi Prasad.

  • How do i  open browser in java application

    hi....
    please help me!!!!!!!!!!!!!!!!!!!!!!!!!!
    how do i open browser in java application ? ( for show javascript in java application)
    thank you.......

    You can run any program from java by doing
    Runtime.getRuntime().exec("mybrowser myjavascriptfile.js");
    The real question is why would you want to.
    I would suggest you rethink whether running Javascript from Java is a good idea.

  • Building and Deploying Java applications in different platform (OS)

    Hi all,
    We currently have a J2EE based web services application that is built (compiled) and deployed on Windows 2000 Advanced server. But in future, we will be using WIndows 2000 server for development only and HP-UX for production.
    So, we are planning on executing the build (compilation) of our application on Windows 2000 server and deploy the same binaries (WAR) on HP-UX also. So, I wanted to know anyone has faced issues in the past by deploying an application on a different platform than the one on which it was compiled. Is it recommended by SUN to compile and build Java applications on the same platform on which the application is deployed.
    Note that in my case, the JVM versions between Windows server and HP-UX would be the same. But the JVM for Windows server has been provided by Sun and the JVM for HP-UX has been provided by HP-UX.
    Your inputs are greatly appreciated.

    Well, it's all Java, right? So what's the problem? Since the JVM for HP-UX isn't made by Sun, so there could be compatibility problems, but I would expect that would be minimal if a problem at all. But you can't know unless you run it.
    I don't know about building on the different systems. Java's supposed to be write once, run anywhere.... The byte code should be compatible no matter what. I've never heard of Sun saying "compile it on each platform". If the HP JVM isn't going to like bytecode compiled on Windows or another OS, then something isn't kosher with someone's JVM or compiler.

  • How to change country and keeping all application upgraded ? thx

    how to change country and keeping all application upgraded ? thx

    you may change the userID/ passwd from menu or create conn segment for each of the userID/ passwd combination .

  • How to invoke java application from ABAP

    How to invoke java application from ABAP  ? Suppose I needto execute a EJB wihic is running on my SAP J2EE Enigne from an ABAP Program .
    Thanks,
    Manish

    Hi Manish,
    did you get some further documents concerning "abap program calls ejb"?
    If yes, could you please send me some informations.
    Thank you for your help.
    Kind regards, Patrick.

Maybe you are looking for

  • Mac Pro keeps crashing.

    Everytime I come back to my computer after I've been away for awhile it's off. I restart it and I get an error. I'm not sure what to do. Please help! Following is the error report it automatically submits. Thank you! Interval Since Last Panic Report:

  • Networking system

    Dear all, I'm doing my homework and it is very closed to the deadline, pls. help! The question is: Develop a chat system which allows at most 5 clients to chat online. The client window should have the following entities: ?     a text area (called te

  • AppleScript - Writing to non-existent directories, and non-existent files..

    All, AppleScript - Writing to non-existent directories, and non-existent files... Creating directories several levels deep on the fly. How do we write to a file that does not exist, buried deep down in a hierarchy of directories that don't exist eith

  • HT1349 mp4 not playing on my laptop and it was last night

    star trek will not resume playing apparently due to this error

  • How to install SSL certificate on OSX 10.9.5?

    Hello, I purchased an SSL certificate from RapidSSL for my website. Somehow I am supposed to install this on my Mac but they are not able to provide me with instructions (great service). Can anyone help me? Thanks!