How to call a external program in java program

for example, if I want to execute internet explore or windows word in java program, how to do it?

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html

Similar Messages

  • How to call a external program in java?

    Help!!
    Is there any method that can a java program can call a external program? For example execute a exe file.
    Thanks.

    Yes.
    Runtime.getRuntime().exec("exactly what you would type at the command line");
    But be aware that this is operating-system-specific and full of gotchas. When you run into one of them, come back to the forum and do a search, this is a frequent topic of discussion.

  • How to call a external software in java program?

    for example, if I want to execute internet explore or windows word in java program, how to do it?

    // Modified from Just Java
    import java.io.*;
    public class execDir {
    public static void main(String args[]) {
    try {
    Runtime rt = Runtime.getRuntime(); // step 1
    Process prcs = rt.exec("doDir.bat"); // step 2
    InputStreamReader isr = // step 3
    new InputStreamReader( prcs.getInputStream() );
    BufferedReader br = new BufferedReader( // step 4.
    isr );
    String line;
    while ((line = br.readLine()) != null)
    System.out.println(line);
    } catch(IOException ioe) { System.out.println(ioe); }
    Maybe this will help you.

  • How to call SAP Webservice in standalone java program

    Hi,
    In our Java application, we want to use the SAP Webservices. I dont know much about authentication mechanism used by SAP. Can any one please help me with any sample code how to Call SAP webservice in Standalone Jave Program. I searched alot on the web regarding this, but helpless. Please help me.
    Thanks,
    Mohan

    Hi Mohan,
    You need an account for the ES Workplace. I'm afraid this is not free, e.g. check [SAP NetWeaver, Composition Subscription|https://www.sdn.sap.com/irj/sdn/subscriptions/composition].
    But I thought you wanted to play with a WSDL [you already had at hand|Sample code to access BAPI Web services from JAVA required;?

  • When I call an external program from Labview, how can I embed the interface into the front panel?

    I'm running Labiew 6i for Linux. I'm using a system exec.vi to call an external program to do image manipulation (since there is no IMAQ for linux). How can I embed the user interface of the external program into the front panel of Labview?

    As far as I know, the only way to embed other GUIs in LabView is an ActiveX in a container.
    As long as you are using Linux, try to place (moving them on the desktop ) the two windows linked (like those 3 of WinAmp).

  • How to Call abap functn/program from java layer

    Hi all,
        I have to develop a program which has to call abap function/program from java side or how to call a abap program through java ..
    pls send me related links or explanations.. dont send unrelated answers..
    Regards,
    Arivarasu S

    Hi,
    You mean accessing ABAP functions from J2EE perspective, then I think we can do this by using SAP Java Resource Adapter and also through webservices.
    SAP Java Resource Adapter (SAP JRA) can be used as an add-on for the SAP JCo SAP JRA enables the implementation of standard interfaces from diverse J2EE servers to the SAP JCo in the SAP Web AS. The SAP JRA thus simplifies
    communication with ABAP within heterogeneous J2EE landscapes.
    Go through the following links which has Good documentation on how to achieve this
    Accessing BAPIs Using the SAP Java Resource Adapter
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4]
    Connectivity and Interoperability
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/326d82e5-0601-0010-fca4-9caf27b89c26]
    Finally with WebServices. Accessing SAP Business Functions (ABAP) via Web Services
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e45561a3c4]
    Regards
    Raghu

  • Calling an external program!

    Salut all, Im using unfortunately Oracle Forms 6i, and I need to call an external program that I have to develop in Java, compiled into .jar. I just wanna use something like java -jar myJar.jar <my params...> but I don´t know how to call external programs from Oracle Forms, in special from 6i.
    I have searched this thread passed (Re: Calling JAVA from PL/SQL but didn´t help me so much.
    Thanks all for patience!

    In version 9 and 10 we have a general way of calling out to java thru the Java Importer functionality.
    If you cannot upgrade to these later versions and you don't need to get data back from the jar file execution you can always use the Host command to call it directly the way you have outlined.

  • How to call a VB application from Java

    Hi,
    does anybody know how to call a VB application from java.
    Would appreciate if you can provide me with an example.
    thanks

    try exec()ing the cad program with the name of the file as a command line parameter...
    Runtime.getRuntime().exec("CADProg.exe Test.prt");
    i have no clue if this will work but it seems like it's worth a try.

  • How to call an external web service from OIM?

    Hi,
    I have a question on how to call an external web service from OIM within e.g. creating user process? How should it be done; through adapter and task in the process?
    Any recomendations?
    Thanks in advance!

    it is not clear to me if you are having problems with calling java code from OIM or if the problem is the web service API.
    Lets do some divide and conquer:
    Can you create a simple java class that just writes a couple of lines to the log? Please attach this code to the OIM task and make sure it runs.
    Once this works we can start looking at the web service call.
    Best regards
    /Martin

  • Before calling an external program, check if the program is allready open

    I need to call an external program to print some labels, so i will use function WS_EXECUTE or the new one DSVAS_DOC_WS_EXECUTE_50 to call my program, but the problem that i have is:
    when I call this function, the program open a small window, and if i have to call it again, it will open another window, and so on... obviously this is not a good solution.
    Is there any one how knows how can i close the program, of perhaps it is enough if there is some way to know if the program is already open.
    Many thanks in advance,
    Miriam

    Hi
    you can use the ABAP Coverage Analyzer.
    OR
    This is a function module we use to limit the execution of a program to one instance at a time.
    DATA: PRG LIKE INDX-SRTFD. PRG = SY-CPROG.
    CALL FUNCTION 'ENQUEUE_ESINDX'
    EXPORTING RELID = 'ZZ'
    SRTFD = PRG
    SRTF2 = 0
    EXCEPTIONS FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2.
    IF SY-SUBRC NE 0.
    FORMAT COLOR COL_NEGATIVE INVERSE ON.
    WRITE: / 'ERROR: Program Is Already Running'.
    WRITE: / 'Program', PRG, 'has been stopped. Rerun in 1 minute.'.
    STOP.
    ELSE.
    WRITE: / 'OK ',PRG.
    ENDIF.
    Regards,
    Raj

  • Calling an external prgram in java

    How would you go about calling an external program like xyz? If xyz is called in the following manner:
    xyz info_a=normal info_b=test info_c="text message"
    Thanks!

    Thanks for the tip.
    I got the call now but can someone tell me what this will pass?
    Runtime.getRuntime().exec("opcmsg severity=normal application=Runtime object=Notes msg_grp=World msg_text=\"'Test - look\"'");
    I can run this when I cut it out and run it command line, but it doesn't run when executed from my program.
    Thanks in advance for the help.

  • How to call the method from the java bean and pass it to JSP textbox

    i'm quite new to java thats why i'm asking how to call a method in the java bean file and pass it to the JSP textbox. My projects are communicating JSP with C#. i had successfully created a C# client bean file for JSP. The whole process is to type something on the server(C# programming) and it would appear in the textbox.

    your question doesn't provide much informartion. provide some other information and coding so that we could tell exactly what you are looking for?

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • Calling an external program (*.exe file) on the client

    Hi,
    I use 9iDS and I'd like to call an external program (*.exe file) on the client, but this exe file is located on the server not on the client.
    So it should be something like a mixture between host and client_host(webutil) command. Is it possible to use client_host where a virtual path is passed to?
    Regards Sören

    Are you saying you want to run on the exe on the client but its located on the server???
    In that case you would have to do a webutil file transfer to move it to the client before executing. Or, if you are calling a DLL, webutil will download it automatically from the server to the client (see the C API example on the webutil page).
    Regards
    Grant Ronald
    Forms Product Management

  • How to call the abap program in workflow

    HI Exeprts,
    I need to call one abap program in workflow.
    can any tell me how to call the abap program in workflow.
    thanks &regards
    ramesh

    Dear Ramesh,
    U can use REPORT business object.
    Method : EXECUTE_2
    Regards,
    Sagar

Maybe you are looking for

  • How do I change an account from personal to add to...

    Hello, I created three new personal accounts for the three new employees of our company. I then opened the administration panel and realised it would have been better if I had created them as business accounts rather than personal accounts (to manage

  • Unable to SAVE data through a data form in Hyperion Planning

    Hi, I recently migrated an application from development to QA using the LCM tool and refreshed the outline into Essbase using Planning Web. Once completed, i loaded the level0 data and aggregated it. I opened a data form and tried to SAVE data and i

  • XDCAM EX and FCP 6

    Loaded footage from the new XDCAM EX directly into my Macbook Pro and Intel Mac. FCP 6 worked perfect and editing is great (very fast). I imported each type of video recording format and had no problems. The only issue I ran into was when I sent foot

  • URGENCY! problem with printing with Epson matrix printer

    I have Epson printers : LX-300+ and FX-980. I want to print a report from an Oracle application on continous paper.My report is one page. The printer is set with: auto tear off=on page length for tractor=12 (inches) At the first print job the paper a

  • SAPScript  / SmartForm - 2 Forms & 2 Printer

    Hi All, I have a requirement as below. Please suggest me a suitable solution. 1. The SAP Standard Program calls the Form. The Standard Form is modified to accommodate the client specific changes and added in Customization. 2. If the numbers of pages