How to call external files from java?

How to call external files in java. For example how to call a *.pdf file to open in its default editor(say Acrobat), or a *.html file to open in the default browser or a *.txt file in a notepad etc..,
In my program i have *.chm (Compiled Windows HTML Help) help file. how to open it in its default editor it?

Jayarathina_Madharasan wrote:
no one answered my questionHi what wrong did i do...basically insulted all the volunteers here who took the time to consider your question and try to offer you help. Other than that, you did nothing wrong.
From JavaRanch :
And even if an answer doesn't solve your problem, even if it should totally miss the point - the best thing to do to motivate others to continue trying to help you is showing respect and gratitude for the investment of time that was put into dealing with your issue.
Edited by: Encephalopathic on Apr 14, 2008 10:01 AM

Similar Messages

  • How to Call .XDO file From Java Program

    Hi,
    I have developed a report in using BI Publisher version 10.1.3.
    I created the report and it only created XDO files. If I want to call XDO file from Java program how I can do that.
    What are the APIs available to do that.
    Thanks
    -Ashutosh

    Hi,
    the JavaAPI didn't work with the xdo-Files. But you can create a proxy stub for the Web Service API of BI Publisher which uses the xdo's in the repository.
    regards
    Rainer

  • How to call gnuplot command from java

    Hi there,
    In our course, we are required to develop an GUI for gnuplot. In case you don't know about gnuplot, it's a plotting program and has lots of command. We want to use java and swing, but now we don't know how to call gnuplot command from java, or how to execute a shell command(script) from java.
    By the way, since we need read in files with several columns of data and allow user to select a column, we want to use JTable. Is that reasonable?
    Thanks a lot for any suggestions!
    Jack

    Hi, there:
    Will using JTable add much overhead? I may have to use several JTables and switch among them. I can add scroll bar to or edit JTables, right?
    BTW, do you have experience about gnuplot? Can I find the command tree of gnuplot somewhere? Or do you know a better place to post question about gnuplot? unix/linux group, maybe.
    Thanks,
    Jack
    P.S. Would you guys answer my question after I use up my duke dollars? :- )

  • Calling external programs from Java?

    Hi All,
    Is there a way of calling external applications from Java without using Runtime.exec(). That method seems quite messy when you are dealing with streaming data from an input file to an output file. Basically what I'm asking is there a way to run a command the same way you would type it in a command shell?
    Thanks

    LeWalrus wrote:
    Ok, I've an external application that I want to be called inside a Java GUI. It has several input arguements, which the format looks something like:
    programname inputfile > outputfile
    Simple enough.
    >
    Works fine from a shell command line. From what I understand, this won't work using Runtime.exec() because that method will just start the application. Works fine from Runtime.exec(). Since you are'>' to write stdout to a file you need to us a shell to execute the command.
    String[] command = {"sh", "-c","programname inputfile > outputfile"};
    Process process = runtime.exec(command);
    You need to read, digest and implement the recommendations given in http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html .
    File input and output from the application has to be taken care of programatically (java.io stuff). Fine if you've only one input and output. But if you have several input files and hundreds of output files, where does this leave you. It would be much easier if you could pass a string command to the shell directly as if you typed it in the command line yoursel!

  • Call .bat file from java code

    I need to call an application that uses a .bat file to execute from a java program. Is that possible?
    This is the .bat file:
    importcli.exe ciaf2735 C:\Importcli\files\SAI2735*.txt  
    importcli.exe ciaf2735 C:\Importcli\files\CI2735*.txt  
    importcli.exe ciaf2735 C:\Importcli\files\SC2735*.txt  
    importcli.exe db1800 C:\Importcli\files\*.mdb

    magaupe wrote:
    I need to call an application that uses a .bat file to execute from a java program. Is that possible?
    This is the .bat file:
    importcli.exe ciaf2735 C:\Importcli\files\SAI2735*.txt  
    importcli.exe ciaf2735 C:\Importcli\files\CI2735*.txt  
    importcli.exe ciaf2735 C:\Importcli\files\SC2735*.txt  
    importcli.exe db1800 C:\Importcli\files\*.mdb
    Hmmm, I wonder what would happen if there were a web search engine and you could research like this:
    [http://www.google.com/search?hl=en&q=call+.bat+file+from+java]

  • I wants to call .Exe file from Java Programme

    I wants to call .Exe file from Java programme. Please give answer with example. This very urgent. Help me

    hi
    u can use Runtime.exec() method in java.lang package
    to execute exe files
    regards
    pnp

  • How to run perl file from java file..???

    Hi All,
    How to run a perl file from java file.I know that there is one JPL(Java-Perl Library) preprocessor which can be used to do this,but no idea of how to do it..
    Any help is appreciated.
    Thanks in advance.

    viswa07 wrote:
    Ok and any idea regarding JPL..????I don't know it and the first few posts that I found mentioned it using Java 1.1-style JNI calls, which hints at a dead project. And you don't want to use a dead project.

  • How to Call C++ Method from Java

    I need to call C++ method from Java.
    I have gone through the JNI tuorial , but was not able to pin point things.
    I read that :
    You have to write JNI c functions which then call your C++ member functions.You need to write a JNI function which will call new on your C++ class.
    Now i have java class :
    Java Code JavaClass.java ---->
    class JavaClass{
    public native void nativeMethod();
        static
            System.loadLibrary("NativeCppCode");
         private void callCppMethod()
              //call C++ method
                    JavaClass jvc = new JavaClass();
                    jvc.nativeMethod()
    }Cpp Code:
    NativeCppCode.h---->
    class NativeCppCode
    public:
        getValue();
        setValue();
    private:
       int a;
    JNIEXPORT void JNICALL Java_JavaClass_nativeMethod(JNIEnv *env
                   ,jobject obj);NativeCppCode.C---->
    NativeCppCode::getValue()
       return a;
    NativeCppCode::setValue()
       a = 1;
    JNIEXPORT void JNICALL Java_JavaClass_nativeMethod(JNIEnv *env
                   ,jobject obj)
    NativeCppCode* nativeInstabce = new NativeCppCode();
    NativeCppCode.setValue();
    }Is this the correct way to do it.
    Any suggestion would be a great help to me

    tryit wrote:
    I need to call C++ method from Java.Not possible.
    JNI uses C methods.
    Is this the correct way to do it.Same way you would do it in any C/C++ method (not java)
           MyClass* p = ....
           p->doit();
    Common idiom for the pointer in the above is to pass it back and forth to your java code as a java long. You cast it it and from your class pointer. Provide an explicit java method to free it when done. Besides providing the explicit method also implement a finalizer to free it as well (however that is a fail safe and should not be relied upon.)

  • How to Call a JSP from Java Script

    Hi,
    I want to call a jsp from Java Script.
    I am having IntelliJ IDEA 4.5 (IDE) and weblogic server.
    should i do anything on web.xml,weblogic.xml
    I have written one jsp, Java script.
    I want to call a jsp from Java script

    function submitf(){
    document.xyz.action ='ReportSave.jsp';
    document.xyz.method='POST';
    document.xyz.submit();
    <form name='xyz'>
    <input type='text' name='text1'>
    <input type='text' name='text2'>
    <input type='button' name='xx' value='submit' onclick= submitf()>
    </form>
    Is this what u want???
    Regards,
    RAHUL

  • How to run SQL files from Java?

    Hi,
    Can someone point me towards a link on how to run sql files in Java? Thanks.
    P.S...if I've been completely blind please go easy on me!

    Sorry forgot the formating code thingy
    public static boolean executeScript(File script, Connection conn){
        boolean success = true;
        success = script.exists();
        if(success){
          DEBUG.print("ES::READING SCRIPT:" + script.getAbsolutePath());
          StringBuffer buffer = new StringBuffer();
          success=readScript(script,buffer);
          if(success){
            try{
              String creationScript = buffer.toString();
              Statement st = conn.createStatement();
              int start = 0;
              int end = 0;
              while (end != -1 && start < creationScript.length()) {
                end = creationScript.indexOf("GO", start);
                if (end != -1) {
                  DEBUG.print(creationScript.substring(start, end));
                  st.executeUpdate(creationScript.substring(start, end));
                  start = end + 2; //2 is the length of "GO"
              st.close();
            }catch(Exception e){
              success=false;
              DEBUG.printStackTrace(e);
        }else{
          DEBUG.print("ES::SCRIPT FILE DOES NOT EXISTS");
          success=false;
        return success;
      public static boolean readScript(File script, StringBuffer buffer){
        boolean success = true;
        DEBUG.print("RS:: reading file :" + script.getAbsolutePath());
        try{
          InputStreamReader isr = new InputStreamReader(new FileInputStream(script),"UTF16");
          int ch;
          while ( (ch = isr.read()) > -1) {
            buffer.append( (char) ch);
          if (isr != null)
            isr.close();
        }catch(Exception e){
          success=false;
          DEBUG.printStackTrace(e);
        return success;
      }

  • Call .jrxml file from java or jsp

    hello experts,
    i want to know how to call or execute the .jrxml ie report file from the jsp or java
    and how to pass the runtime query to the report?
    urgnt

    The below posts should answer your question
    [http://forums.sun.com/thread.jspa?threadID=5203324&messageID=9811077]
    [http://forums-beta.sun.com/thread.jspa?messageID=9857221]
    On the same note please make an effort to search google about jasper API.

  • Calling batch file from java Program

    I have made the java program in which i have called the batch file.But the problem is this that when i call batch file locally it executes normally but when i try to execute batcvh file from remote machine it doesn't runrather it gives Runtime IO execption.Error123.Can anyone provide me the solution for this?

    Not without a lot more information. Like for example how you are trying to execute this remote batch file, the code you are using to do that, what kind of server you have no the remote machine to let you remotely execute code, and so on.

  • How To : Call External Webservice from BPEL and pass SOAP Message to the WS

    Hello All-
    Greetings to all BPEL gurus. I am currently facing difficulties in calling an External Webservice from my BPEL Process and passing SOAP Message to it. The details are below:
    <strong>1. The BPEL process, using database polling feature of DB Adapter, will get the records from the database.</strong>
    <strong>2. Transform the message</strong>
    <strong>3. Call the External Webservice and pass the transformed message as the input to it. However the Webservice expects the BPEL process to send SOAP headers in the input message.</strong>
    I am struggling on how to put the transformed message within a SOAP envelope in the BPEL process.
    If anyone had similar requirements and have successfully been able to send SOAP messages from BPEL process to an external webservice, kindly let me know.
    Also if there is some kind of documentation or any link in the forum that I can refer, please let me know that as well.
    I am new to Webservice integration using BPEL and would really appreciate your help.
    Thanks In Advance
    Regards,
    Dibya

    Hi Dharmendra,
    I am trying to send a SOAP message from my BPEL process to a web service. I have a complete SOAP message in a complex variable defined in the wsdl for the partnerlink (web service). My problem is that when I invoke the partnerlink it fails even though the content shown in the BPEL console looks valid.
    I have set up obtunnel to see what I am actually sending out from BPEL. You mention that BPEL creates the SOAP envelope automatically.
    I think that my problem is a result of this automatic SOAP envelope that BPEL is creating. Do you know if there is a way to turn it off?
    This is what I see in the TCP monitor, please note the double SOAP env:Body:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <RCMR_IN000002NR01 xmlns="urn:hl7-org:v3" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <env:Header>
    <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">http://testhost/CCS/Service_Endpoint</wsa:To>
    <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://localhost/CCS/Service_Endpoint</wsa:Address>
    <wsa:Metadata>
    <device xmlns:hl7="urn:hl7-org:v3">
    </device>
    </wsa:Metadata>
    </env:Header>
    <env:Body>
    <RCMR_IN000002NR01>
    </RCMR_IN000002NR01>
    </env:Body>
    </RCMR_IN000002NR01>
    </env:Body>
    </env:Envelope>
    Any help is appreciated.
    Regards,
    Aagaard
    Edited by: Aagaard on Oct 30, 2008 8:59 PM
    Should have mentioned. I am using BPEL 10.1.3.4
    Edited by: Aagaard on Oct 31, 2008 8:43 AM
    I have opened a new thread for this question so as to not confuse the issue more than necessary.
    How many SOAP envelopes do you really need?

  • How to call BPM process from Java

    Hi All,
    Can anybody help how to call a BPMN process from java.Please give any sample exaple on this.
    Thanks,
    Ganesh

    For 11g BPM please look at this post. Re: Getting while running the BPEL process from java
    It references an ATeam example app that can start processes from a web client. But the Java APIs are described too.

  • Calling external servlet from java stored procedure

    Hello,
    I need to call an external servlet which is in 9iAS server ( unix box) from Java Stored procedure in oracle database.
    Can anybody give me an idea? is it possible?
    Thanks,
    Viswa

    I am trying the same. Here is URL which will help u.
    http://otn.oracle.com/sample_code/tech/java/jsp/samples/wsclient/Readme.html
    Let me know when you run servlet successfully.
    Regards
    Satish

Maybe you are looking for

  • User exit / substiution /  badi for changing baseline date

    Dear Experts ,                        I have a requirement to change the base line date of residual document created in F-28 / F-32 to the base line date of original document getting partially cleared . I have explored the option of substitution but

  • Read text file and split up.  How???

    Can anyone tell me how to split up a string into words. The string is: "me and my cat both like milk and cookies" I need read through the file and diplay the biggest word(s) and the smallest word(s). I would appriciate help on this as i am really stu

  • Unable to upload images in my blog

    Dear moderators, Sorry to post question in this forum. I am facing issue while uploading images to the blog, "browse" button comes as disabled and I am not able to upload any images. Kindly help me to resolve this issue? Regards, Sanjana

  • What is the complexity of List.subList()?

    I realize that the complexity of List.subList() probably varies, so is there a complexity for subList() when using a LinkedList and and ArrayList? From the description in Abstract set, It sounds like subList() returns the same list, except with some

  • Difference between Oracle Portal & Oracle Forms

    What is the difference between Oracle Portal & Oracle Forms and when would use them? Thanks