Using java to run another application

How to use java code to execute another program such as MS Word and etc? and how to locate the java running program into the right side windows?
Thanks

It woulds to me like you would like to do some OLE, and have the product open up into your application like it does in C/C++, VB, or J++ applications. If this is the case I would as: do you know how to do this using C/C++? I ask this because the only way I know of to do what you ask for is with a lot of C/C++ code using the OLE interface for the products you would like to incorporate.

Similar Messages

  • Run another application

    hello peepz...
    i was wondering if it is possible to run another application when the user open another. what i mean is when user open applicationA, it will automatically run applicationB. The reason why i need this is because i want to use applicationB as a database engine to poll data from a device but i cannot combine applicationA and applicationB together in one application because when i run the engine, the program just hang.
    so would appreciate it if someone show me how i could do that...
    thanx
    farah k.

    As in
    MainClassOfApplicationB.main(someArgumentArray);?^
    The question is: is "running" it all you want to do or do you want those parts to actually communicate?

  • Error message Indesign:Either the file does not exist, you do not have read access to it, or use the file in another application.

    I've got problem with opening a file in InDesign. The file type is an InDesign Markup Document. The error message is: Either the file does not exist, you do not have read access to it, or use the file in another application. What's wrong?

  • How to run another application in the project?

    Well, the title says it all really. I created a new
    application within my existing project but I can't get it to run as
    it always runs my main application (which has a little blue sphere
    on its icon).
    How can I get the other application to test and/or
    run?

    Managing launch configurations
    Launch configurations are used both to run and to debug
    applications. Flex Builder provides a default launch configuration
    for Flex and ActionScript applications. When you first run or debug
    a project, a project-specific launch
    configuration is created. You edit the launch configuration
    to change the default main application file. You can also
    modify the default launch path to run or debug in the
    stand-alone Flash Player rather than in a web browser.
    Creating or editing a launch configuration
    When you create and build a project, it is ready to be run or
    debugged. Both running and debugging of the applica-
    tions in your project are controlled by a launch
    configuration. By default, Flex Builder creates a launch
    configuration for each of the application files in your project the
    first time you run or debug them. The configurations are based on
    the default Flex application configuration, and you can edit them
    as necessary.
    Launch configurations are managed in the Create, Manage, and
    Run Configurations dialog box.
    using_fb_flex3.pdf
    Chapter 11: Running and Debugging Applications

  • What the use if u run in application server

    hi friends,
    at info pakcage level  we can use client server and application server, for process chain we are using application server. what is the use if  we run in the back ground process.
    Thanking u
    suneel.

    hi Suneel,
    i think you mean for flat file upload,
    for flat file upload there are options for the file in application server or in client side, and to run infopackage there is option background,
    if we choose background process, we have to use option 'application server',
    means the file must be put in server side
    hope this helps.

  • Calling a Taskflow present in one App using a url from another Application

    Hi,
    I a have a requirement to call a taskflow present in another Application using a url from present JDEV Application.
    Is that possible in JDEV 11g? Can anyone give me an example.
    Thanks,
    User
    Edited by: user617801 on Feb 24, 2009 11:24 AM

    Hi,
    Check out this example . It is for TP4, but it should be the same on WLS.
    Pedja

  • How to use java output with other application

    hi ,
    I am using acme.crypto to encrypt data. this is completely written in java. i need to pass input to this using VB6 and return the output to VB6
    how can i achieve the same, is there any readily available dll that can be used in vb?
    I am rigorously searching solution, which i am not finding.
    I need to know how should i place the java code so that it could be used with VB, as i am new to java world. Do i need to create component using java bean or how?
    The code i refered above is nothing but encryption algorithm. I need to pass the input string from vb to java, which will process me the output which inturn should be passed to vb6.
    Kindly guide me through this.

    Why not create a Java ServerSocket in your Java program.
    Connect the VB program to this ServerSocket.
    Send the input to the Java Program over this socket and have the Java Program encrypt the information and pass it back on the same socket.
    Don't know how hard Sockets are in VB6 but a Server Socket in Java is simple.
    No need for new DLLs, JNI, etc.

  • Use java to run a shell script which called a crontab command at Unix

    I was trying to write an automate function using Java, which needs to call a shell script containing a crontab commend. The shell works fine without that crontab commend, but once I add it, the program won't execute that crontab commend.
    public void cron(){
    try
    Process proc = Runtime.getRuntime().exec("script1");
    BufferedReader br = new BufferedReader(new           InputStreamReader(proc.getInputStream()));
    String line;
    while ((line = br.readLine()) != null)
         System.out.println(line);
    int returnValue = proc.waitFor();
    br.close();
    } catch (Exception e){} //
    script1:
    #!/bin/sh
    crontab cronfile
    Can someone help me out for this? Thank you.

    Try this....
    Process p = Runtime.getRuntime().exec("sh");
    java.io.BufferedWriter bw = new java.io.BufferedWriter(new java.io.OutputStreamWriter(p.getOutputStream()));
    bw.write("script1");
    bw.flush();
    bw.close();

  • Using Java Applet in WebDynpro Application

    Hello,
    I have the problem that I must access the client in my WebDynpro Application.
    But I found no way to include a Java Applet in my application, so my question: Is it generally possible to include a Java Applet or not?
    If it is not possible with an Applet, is there any other way to access the client?
    Thanks a lot

    We actually embed Java applets in our application. But only on the portal.
    Wrap the applet around a BSP.
    Call the URL in an iframe.
    To prevent the reloading problems that we see with applets and actions, we put the applet in a modal window, with an OK button at the bottom so that when applet processing is finished, the rest of the web dynpro functionality resumes.
    If you need to have them both in the same page, you can embed the BSP iview in the same portal page.

  • Using an Applet to run another application

    To anyone that can help.
    Simply, can I have an applet that runs an PC application?
    More detail:
    I am relatively new to the Java Development environment, but so far have put together a reasonable intranet web application that takes user input and writes to an Oracle database. From this information, I have then invoked Microsoft Word and populated a template with information to create a document.
    All fine and good, but I am running everything under W2000 so I have server and client all in the one place. I am using Tomcat 4 as my server, the application is written using JSP and my own Beans.
    The principle of how the Word link works is: within the JSP information is written to a Bean, which creates a file and then executes a WordAPI using:
    cmd = "WordAPI.exe";
    try {
    Runtime.getRuntime().exec(cmd);
    This is OK with everything on one machine, but I now need to set it up on a server and this will not invoke Word on the client. I thought that if I turned the bean into an applet then it would run at the client end and that would resolve the problem, but it doesn't work. Am I breaking some rules or trying to do the impossible?
    Thanks for any help

    I think it boils down to a matter of security. An applet generally runs in what is known as a sandbox. Since you're talking about an intranet and you didn't say anything about Netscape browser, I'll assume that you're only interested in IE. In IE, you can start by testing to see if your application will work if you click:
    Tools-->Internet Options-->Security-->Trusted sites-->sites
    and add the intranet URL to make it a trusted site.
    If that doesn't work, you may have to sign the applet and put it in a .cab file. To do this you'll need to use the cabarc command (if you can't find the command on your system, search www.microsoft.com web site for a download). After having signed the applet, you still have to make sure that the client's IE security settings are just right for what you needed to do. For this, you'll have to look at:
    Tools-->Internet Options-->Security-->Local intranet-->Custom Levels...
    Good Luck!
    V.V.

  • Using java to run command line as %username%

    Hi all,
    can any one help with this?
    I'm trying to run a command line from a database as %username% in Windows. So far I have the following script, courtesy of Frank Naude to build a java class that is published within a plsql procedure. A command line can then be passed to it.
    rem -----------------------------------------------------------------------
    rem Filename: oscmd.sql
    rem Purpose: Execute operating system commands from PL/SQL
    rem Notes: Specify full paths to commands, for example,
    rem specify /usr/bin/ps instead of ps.
    rem Date: 09-Apr-2005
    rem Author: Frank Naude, Oracle FAQ
    rem -----------------------------------------------------------------------
    rem -----------------------------------------------------------------------
    rem Grant Java Access to user USER1
    rem -----------------------------------------------------------------------
    conn sys/password@database as sysdba
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    EXEC dbms_java.grant_permission('USER1', 'SYS:java.io.FilePermission', '/bin/sh', 'execute');
    EXEC dbms_java.grant_permission( 'USER1', 'SYS:java.io.FilePermission','C:\WINDOWS\system32\cmd.exe', 'execute' );
    rem -----------------------------------------------------------------------
    rem Create Java class to execute OS commands...
    rem -----------------------------------------------------------------------
    conn user1/password@database
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\WINDOWS\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    // Execute the command...
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    // Capture output from STDOUT...
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("stdout: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    } catch (IOException ioe) {
    System.out.println("Error printing process output.");
    ioe.printStackTrace();
    } finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    // Capture output from STDERR...
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("stderr: " + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    } catch (IOException ioe) {
    System.out.println("Error printing execution errors.");
    ioe.printStackTrace();
    } finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    show errors
    rem -----------------------------------------------------------------------
    rem Publish the Java call to PL/SQL...
    rem -----------------------------------------------------------------------
    CREATE OR REPLACE PROCEDURE host(p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    show errors
    rem -----------------------------------------------------------------------
    rem Let's test it
    rem -----------------------------------------------------------------------
    exec host('notepad');
    The trouble is although this script works great for commands that can be run is the 'background' as SYSTEM is I want to pass a command to actually open something e.g. notepad in the above example nothing seems to happen. As far as I can make out the command line is running but not as %username% so it's not running notepad.exe in the foreground.
    I'm happy to clarify more if necessary.
    Can anyone help with this?
    Cheers
    Yog

    Bill,
    Thank you for the quick answer. I believe you are right in your assumption.
    I have been searching but found nothing so far.
    I need to be able to run this line "wmic
    Product where name='XXX XXX XXX' call uninstall" 
    in an elevated command prompt to uninstall the program.
    I was looking for a VB script or PowerShell to execute it remotely on non domain roaming PCs.
    Th3e command can be run remotely against stand-alone workstations but you must supply credentials.  Post in the platform forum for you version of Windows for help in using the WMIC utility.  WMIC /? will give you all of the command options fro
    remote execution.  UAC only affects local systems.  You cannot use WMIC to remote back to the local system. WMIC does not allow impersonation to the local system.
    Most installers will not automatically allow an unattended uninstall.  If there is any dialog at all the uninstall will fail and can hang.
    I recommend contacting the vendor of the application to get more information.
    In all cases you cannot bypass UAC as Bill has noted.  I am only noting that, sometimes, in a workgroup, you can use WMIC to remotely uninstall an application.
    ¯\_(ツ)_/¯

  • Calling a java webservice from another application say a Vb client

    Hi,
    I have written a simple web service which greets the user "Hello" and using Apache axis and deployed on Tomcat.Everything works fine.
    But lots being said about interoperability but right now i cannot appreciate that as i don't know how to call my webservice written in java to be called from say a VB application or a component running on IIS server.
    Can anyone write a small snippet of code to do that..
    Your help is highly appreciated...
    thanks
    vasubabu bathina

    Hi,
    Thanks for your reply but i am looking for something more.Like how to get the WSDL file from my webservice and writing a simple clinet application accessing the webservice written using Apache Soap.

  • Help! Can't use java command to execute application

    I can compile using the javac command and that works fine. But then it can't seem to find the class that was just created.
    I get this message:
    "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld"
    Please help!!!
    Thanks!

    The file is saved as the class name.
    Here's what happens:
    C:\jdk1.2.2\bin>javac HelloWorld.java
    C:\jdk1.2.2\bin>java HelloWorld
    Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
    Here's the code that I'm trying to get to run:
    The HelloWorld application program
    public class HelloWorld
         public static void main(String argv[])
              System.out.println("Hello World!");
    }

  • Using BroadcastSystemMessage to ping another application

    I have a server application from a vendor that provides various services I need to use.  The vendor also provided a sample client application written in Borland C++ Builder.  I'm trying to implement the same message passing scheme they use in their client ina CVI program, but I can't get past the first step.
    The Borland app first uses BroadcastSystemMessage to ping their server application.  Then it waits for a response from the server in the form of a WM_COPYDATA windows message.  The original Borland code for pinging the server looks something like this:
       UINT ping_id = RegisterWindowMessage("client_ping");
       DWORD dwApps = BSM_APPLICATIONS;
       BroadcastSystemMessage( BSF_NOHANG, &dwApps, ping_id, (WPARAM) m_client_handle, 0 );
    The m_client_handle is the windows handle of the client application.  The server uses that handle to send it's reponse directly back to the client. My CVI implementation of the ping looks like this:
        GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, (int *)&ClientWindowHandle);
        int PingId = RegisterWindowMessage("client_ping");
        DWORD dwApps = BSM_APPLICATIONS;
        int err = BroadcastSystemMessage(BSF_NOHANG, &dwApps, PingId, (WPARAM) ClientWindowHandle, 0);
    BroadcastSystemMessage returns a 1 indicating that everything worked fine.
    The next half of the ping is to catch the return message from the server.  The Borland app does this by implementing the call OnCopyData for it's main form.  As best as I can determine, this is essentially a predefined message handler for WM_COPYDATA.  I implemented this in CVI with the following code:
    int main (int argc, char *argv[])
        // this is really the same call as before (i.e., I only get the handle once)
        GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, (int *)&ClientWindowHandle);
        InstallWinMsgCallback (panelHandle, WM_COPYDATA, ProcessWmCopydataMessage, VAL_MODE_INTERCEPT, &panelHandle, &ClientWindowHandle);
    int CVICALLBACK ProcessWmCopydataMessage (int panelHandle, int message, unsigned int* wParam, unsigned int* lParam, void* callbackData)
        PCOPYDATASTRUCT ServerInfo;
        if (message == WM_COPYDATA)
            // process returned message
    The problem is that I never get a call to PrcoessWmCopydataMessage.  Am I doing something wrong in my setup?  In particular, am I retrieving the correct handle for my application and am I sending it correctly in the broadcast message?  Is there any spy tool that allows you to watch all windows messages and reponses so I can determine if the server is doing anything?
    I tired writing my own dummy server just to verify that BroadcastSystemMessage works the way I expect.  The only problem is that I can't figure out how to catch the broadcast message in my dummy server app.  How do I install a callback that will catch broadcast messages?
    One last thing: at first I couldn't get BroadcastServerMessage to compile.  It said it was not declared.  After a quick search on the forum, I added the following line before my inclusion of the windows header:
        #define _WIN32_WINDOWS 0x0410
    It compiles now, but I'm concerned that by faking my Windows version I may have messed up something else.  I running Windows 7 BTW.
    Tony G.

    Hey Tony -
    The reason you get the compile error is because CVI does not define _WIN32_WINNT in the version of CVI you are using.  We expect the programmer to define it based on their own needs.  BroadcastSystemMessage is conditionally compiled so that it will not be defined if _WIN32_WINNT is not defined:
    WinUser.h
    #if defined(_WIN32_WINNT)
    WINUSERAPI
    long
    WINAPI
    BroadcastSystemMessageA(
    The consequence of defining it to be 0x0410 is that you are stating your program is compatible with version NT 4.0 of Windows and later.  This means that you can use all functionality of the Windows OS that was available in Windows NT 4.0, but none of the newer functionality will be available to you.  If you try to run your program on a version of Windows older than Windows NT 4.0, the program will likely not run (this should not be an issue...)
    Note that 0x0410 is not actually a defined Windows version.  From a recent version of the Interface to the Win32 API, you can read from sdkddkver.h:
    #define _WIN32_WINNT_NT4     0x0400
    #define _WIN32_WINNT_WIN2K   0x0500
    This means that you are stating your program uses no Windows fuctionality more recent than Windows NT 4.0.  Here's some more good information on using these macros.
    NickB
    National Instruments

  • Using arguments to run an application

    Hellow bodies, Im just a few weeks old in Java, could anyone please help with the following...
    public class SquareTool {
    public SquareTool(String input) {
    try {
    float in = Float.parseFloat(input);
    Square sq = new Square(in);
    float result = sq.value;
    System.out.println("The square of " + input + " is " + result);
    } catch (NumberFormatException nfe) {
    System.out.println(input + " is not a valid number.");
    class Square {
    float value;
    Square(float x) {
    value = x * x;
    public static void main(String[] arguments) {
    if (arguments.length < 1) {
    System.out.println("Usage: java SquareTool number");
    } else {
    SquareTool dr = new SquareTool(arguments[0]);
    /* I dont know how to use this argument (java SquareTool 13) in a command line to run the above program to get the
    * following result (The square of 13 is 169.0).
    * If the program is run without arguments it will give the following result: Usage: java SquareTool number
    * My question is where do I introduce the arguments??
    */

    java SquareTool 13

Maybe you are looking for

  • How do I turn on -XverboseTimeStamp without restarting the server?

    The execute method on the getDiagnosticCommand seems pretty handy for invoking things programatically. I can turn on verbose GC with this command, but how can I turn on the verbose timestamps so I know when the gc occured (without restarting)? Thanks

  • Endpoint Protection Client not running run scheduled scan

    Hi, We are running SCCM 2012 R2 CU1 on our site system and clients, having upgraded from SCCM 2012 sp1 12 months ago. A few of our clients will not run a scheduled scan, even though it displays the Scan date and time in the client properties.  Someom

  • Edits made in Photoshop gain contrast in Lightroom

    I think this is a new one: I'm running XP Home edition and using LR 1.1 with PS CS3. When I take an image into CS3 [ctrl + E] from LR and apply any kind of edit the saved image gained significant contrast when viewed in LR. This happens with dng, jpg

  • Excel read in CVI

    I just open the excel file as 'string' in CVI. I already read http://forums.ni.com/t5/LabWindows-CVI/How-do-I-allocate-memory-for-excel-strings/m-p/754813#M37082 However, I cannot understand it  T-T because I am poor at programming. Does any guys tea

  • Infopath forms

    Hey guys, I'm very new to Sharepoint and unfortunately have no infopath experience. I'm wondering how to create an infopath form in Sharepoint that is a static template that managers from various departments can fill in (such as a new starter form fo