How to start a .hlp-file from a java-application?

This is what I have done so far:
if(button == helpButton){
               try{
                    String helpFile = "help.hlp";
                    Runtime.getRuntime().exec(helpFile);
               catch(IOException e){
                    textArea.append("The helpfile could not be opened." + "\n");
          }When i press the helpButton it throws the IOException. Does anyone know why?

And a short explanation:
You can "start" that file by typing it into the shell, but it's still no executable (.com or .exe). The shell will search the registry for the associated application, run its executable and hand over the file to be opened as a command-line argument.
If you just Runtime.exec the filename, there is no shell that could do this work, and thus the process fails. With "cmd /c" you can invoke a shell session to execute the command.

Similar Messages

  • How to create a exe file from a Java application

    hi,
    i have developed an application in java,now i want to distribute it to my client, for this i need to build a .exe file out of this application.
    i already have a jar file ,now can i convert a jar file to a exe file.
    im trying this out with JSmooth project but im getting it right, so can anyone help me .
    thanks,
    vishal j

    if u use dos to run your app like
    "java myapp"
    u can create a shortcut link
    in target wright java remove the path
    just leave the file name without the extension,
    like this Target: "java myapp"
    when u click on appy u'll c that java gets its full path, thats fine
    that works 4 me, ofcourse ur client needs to have JRE or JDK.

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How to make a jar file from a java file?

    how to make a jar file from a java file, is there any one tht can help me thank you;

    You can study this.
    http://java.sun.com/docs/books/tutorial/jar/basics/index.html

  • How to start an executable program from a java program ?

    Hi,
    does someone know how to start an executable program from a JAVA program ?
    Thanks, Fred.

    Take a look at the Runtime class.
    -S-

  • How to create windows executable file from a java file. Please help.

    Hi,
    For my project I developed the codes in Java. It is working well with java run time environment. But without that I can not run it. I need to create a exe file (windows executable file) from the java source code. If you have any idea please share it with me.
    Even if you know it very lightly, please help with what you know. That would be a big help for me.
    Thank you very much.

    Does anybody know how to read a manual?
    Matt Richardson
    Certified LabVIEW Developer
    MSR Consulting, LLC

  • How to create a .exe file for a java application

    Hi, I want to create a .exe file for a java application I am developing so that I can schedule it to run at a particular time using Windows Scheduler on WinNT. Is there any way to accomplish this? Or is there any other way in which a Java application can be scheduled to run at a particular time on Windows everyday?

    Create a .bat file and run that. Just have, in the .bat file:
    java YourClassName Alternatively, you can use javaw YourClassName (without *.bat, just put it into Windows Scheduler like suggested above).
    using javaw won't pop up any window...

  • How can I list open files from the same application

    I often have several different files open in Word, Excel or Adobe.  However only one is visible.  How do I get a quick list of the other open files from an application?

    Many applications have a Window menu at the top of the screen. Clicking on it will list all the open windows, as well as providing other options depending on the application.
    (113485)

  • How to download a .pdf file from a JavaMail application?

    hi to all,
    iam unable to download a .pdf file from a mailserver using
    my javamail application.i have downloaded all kind of files except .pdf.
    my code snipnet:
    public static void dumpPart(Part p) throws Exception {
    //     if (p instanceof Message)          dumpEnvelope((Message)p);
              System.out.println("CONTENT-TYPE: " + p.getContentType());
              Object o = p.getContent();
              if (o instanceof String) {
                   System.out.println("This is a String");
                   System.out.println((String)o);
                   } else if (o instanceof Multipart) {
                        System.out.println("This is a Multipart");
                        Multipart mp = (Multipart)o;
                        int count = mp.getCount();
    System.out.println("****************************************");
    System.out.println("count" + count);
    System.out.println("****************************************");
                        for (int i = 0; i < count; i++){
                             System.out.println("CONTENT-TYPE: " + p.getContentType());
                             dumpPart(mp.getBodyPart(i));
                        } else if (o instanceof InputStream) {
                             System.out.println("This is just an input stream");
                             InputStream is = (InputStream)o;
                             String filename=System.currentTimeMillis()+".exe     ";
                             FileOutputStream fos=new FileOutputStream(filename);
                             int c;
                             while ((c = is.read()) != -1)
                                  //System.out.write(c);
                                  fos.write((char)c);
    }//dumpPart
    what's wrong with this code?
    Nagaraju.G

    fos.write((char)c);Converting the byte to a char is unnecessary and probably harmful. Just do this: fos.write(c);

  • How to Run a .sql file from simple java class

    How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
    The queries may have different delimiters,queries independant of each other.
    I am able to do with Specific De-limiter.But I need in such a way that there should not be any
    Constraints. Since My .sql may Contain different De-limiters.
    If any one can Suggest Some Solution.
    It will be Great Help.
    regards
    Anil

    Check out ibatis script runner, it' a third party library but quite handy for running sql files...
    m

  • How to Consume a WSDL file in Webdynpro JAVA Application 7.30

    Hi Experts,
    My requirement is,I have a wsdl file(Provided by the SAP PI) which i need to consume in Webdynpro Java 7.3(NWDS 7.30).
    I has been tried in the follwing way
    1.First click on the Model --> Adaptive Web Service Model -->Model Name--Package Name
    2.Choose Remote Location/File System.
    3.After that choose the WSDL file from my project which i added earlier.
    4.After that I get the node in the context menu.But I am uneble to set some data into the node and also uneble to get data data from the node
    After deploying my project I get the following error.
    Error ::
    The initial exception that caused the request to fail, was:
    com.sap.esi.esp.service.server.query.discovery.ExtendedServiceException: Configuration not found for service reference with ID: c73e38ff-a4d8-4e4c-89c2-827fd5cf17ac from application demo.sap.com/mwebsrvc. Either you have not assigned the Service Group to a Provider System or the generation of the configuration has failed. Check the configuration details from SAP NetWeaver Administrator -> Application Communication. --> Details about the Service Reference: {urn://TestSOAPtoRFCSender}SI_TestSOAPtoRFCSender_OB; Service Group: com.tsecl.SITestSOAPtoRFCSender_OB.pidev_nerapdrp_gov_in; Service Group Software Component: demo.sap.com/mwebsrvc; Service Group Application: demo.sap.com/mwebsrvc; Configuration state: Not configured
        at com.sap.esi.esp.service.server.dynamic.DIIServiceRefConfigContextImpl.prepareContext(DIIServiceRefConfigContextImpl.java:275)
        at com.sap.esi.esp.service.server.dynamic.DIIServiceRefConfigContextImpl.<init>(DIIServiceRefConfigContextImpl.java:59)
        at com.sap.esi.esp.service.server.dynamic.DIIContextCreatorImpl.createDIIServiceRefConfigContext(DIIContextCreatorImpl.java:18)
        at com.sap.engine.services.webservices.espbase.client.dynamic.configuration.DIIContextFactory.createDIIConfigurationsContext(DIIContextFactory.java:12)
        at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService_NewInstance(GenericServiceFactory.java:368)
        ... 67 more
    Please help me about this.
    Thanks and Regards,
    Amit Basak

    Hi Amit,
    Create provider system in NWA -> SOA management -> System Connections. After ping is successful go to NWA -> Application Communication and select your DC and assign the provide system for your service configuration group.
    I hope it will works fine as we also did the same.
    - Pradeep

  • Creating an xdp file from flex/java application

    Hi,
    I have an application in Flex 4  and As 3.When I click a button in flex application I have to generate a file in java with
    extension xdp.When I try this locally(Run as java application) the file is generating  correctly.When i compile the applic
    ation and try it, the file is not writing correctly.Do someone have any idea about creating an xdp file from flex application?
    i am using blazeds to connect java and flex4.When i opens the file in notepad the file is writing correctly.There is only problem in openig an xdp file...
    please help me.

    specifically:
    Runtime.getRuntime().exec("filename.exe")

  • How to execute *.BAT file from  the Java Application

    Hello to all.
    I wants to run *.BAT file form my applicaion.
    Can u give the code of that two-four line,please
    Wating four your replay.
    Yours Friend
    Bhavin Shah.....

    pr = rt.exec("cmd.exe /c start " + yourProgramName)The exec() method executes the command you specify in the argument and returns a process. In this example, it's telling Windows to run "yourProgramName".
    HTH

  • How to make an exe file from a java class file

    i know one of the java's most powerfull properties is plataform independent, but if i have done one application (with GUI) that i want to run on Win32 for example, if anyone knows how to make it please send me a message to [email protected], how i know that can be make it? because HotJava is made in Java and in Win32 is a executable

    Do a search on these forums for any of the thousands of times this question has been asked and any of the thousands of times it's been answered.

  • Open a Windows help file from a Java application

    Help!!! Final project due Wednesday. Our project was to re-create the Windows 2k calculator, which we pretty well did, with the exception of accessing the help file. I think I am close but not sure how to deal with the compiled HTML files that Windows uses for its help utilities. The following code makes the calculator itself pop up.
    public void helpFilePopUp ()
    try
    String command = "calc";
    Process child = Runtime.getRuntime().exec(command);
    catch (IOException e)
    System.out.println("Object not found.");
    }//end of method
    Thanks in advance A.

    Maybe I didn't understand your problem correctly.
    If you just want to start the windows help with the calculator helpfile then your command should look like
    "WINHLP32.EXE c:\windows\help\calc.hlp" and not "calc".

Maybe you are looking for