How to run exe in servlet?

I need to run a local exe program and here is the code in servlet.
private static Exception error = null;  
         public static boolean runBatch() {  
              boolean result = false;  
              try {  
                   Runtime r = Runtime.getRuntime();  
                   String base = System.getProperty("C:\\Program Files\\UCB\\ATT\\Graphviz\\bin\\");  
                   String target = base+File.separator+"dot.exe";  
                   System.out.println("Target: "+target);  
                   Process p = r.exec(target);  
                   result = true;  
              catch( IOException ioe ) {  
                   ioe.printStackTrace();  
                   error = ioe;  
              return result;  
         } 

You need to handle the result and the error streams.
Carefully read this: [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html] (all 4 pages).

Similar Messages

  • How to run .exe files with Virtual PC for Mac

    Hey Guys, I'm new around here and with mac technology as well. Anyway, I have an iMac OS X 10.5.1 Leopard and I've recently purchased the Virtual PC for Mac 7.0.2 software. So I'd like to know how to use this program properly, because I need to run some executable files in my computer. It is confusing for me because I don't know how to get started, and I only get to the part when it says "OS not found, Install an OS on this hard drive".
    Honestly I've no idea of what an OS is or where do I get that. So I'd really appreciate if one of you guys could tell me, step by step, what to do to use Virtual PC properly, and finally learn how to run .exe files on mac.
    Thanks in advance!
    Have a nice day!

    Always nice to see new faces
    Honestly I've no idea of what an OS is or where do I get that.
    This brings up the second part of your problem. The first part is setting up either a proper Virtual Machine program like Parallels or VMfusion, or setting up a Boot Camp partition on your drive.
    http://www.parallels.com/
    http://www.vmware.com/products/fusion/
    OS stands for Operating System. You are running Leopard 10.5.7 as an operating system on your Mac (MacOS X).
    The second part of your problem - You will need a copy of Windows XP or Vista if you want to run Windows on your Mac.
    There is at least one other solution for running Windows programs on a Mac. It's called "CrossOver" by a company named 'Codeweavers'. It's based on a project for "Wine" to be able to run PC programs on a Mac or Linux, without having to buy or install Windows. It works with a narrow subset of Windows programs so you would want to make sure the program you want to run is compatible with CrossOver before you buy it.
    http://www.codeweavers.com/products/cxmac/
    In addition to all the above information, you need to upgrade your Mac to the latest 10.5.7 from 10.5.1. "Software Update" is located under the black Apple icon in the Menu Bar at the top left corner of your monitor. After you are updated you will want to update your Profile here so that it shows the proper OS version.
    With your level of experience with MacOS X and the Windows OS's you should probably get some help from a local Apple store. They have an appointment system and do offer many types of help and training, and they can offer assistance with choosing the proper programs for you to purchase for your machine.
    You are also welcome to continue to ask questions here, of course. You will want to ask your questions with different issues that come up in different threads so that the answers stay focused on the title of the thread.
    Message was edited by: dechamp to try to be more accurate with a fairly complicated issue...

  • How to run .exe files in mac pro?

    how to run .exe files in mac pro?
    i am looking for this to play games in my mac pro.
    if someone got a answer, just let me know
    cheers.

    mailking wrote:
    And I fail to see why you are attacking me...
    My comment is Valid...  " .exe files will not run natively on Mac OS X..."
    I am sorry. I had the false impression that it was commonly known that .exe files did not run on Mac OSX natively and failed to see any constructive critique you were bringing. Maybe I am wrong. Again deepest apologies.
    Unfortunately... these days... not every one is aware of this .exe  fact..
    Apology accepted.. and Thank You..

  • How to run exe files using peoplecode?

    How to run .exe extension files using peoplecode. It should execute on clicking a button.can anyone provide sample peoplecode for the same.
    where do i place the exe files ? Local workstation or Server or FTP?
    can i use the same peoplecode if i'm using a button on grid.

    1. You can use function Exec in PeopleCode to run any exe file
    2. You can use ViewContentURL function in PeopleCode to view any .pdf or .doc documents
    Jayaprakash Tedla

  • How to Run a simple servlet "HelloWorld.java" in JBoss 3.0 ?

    Dear all,
    I am a beginner and I want to run a simple "HelloWorld.java" servlet .
    I need to use JBoss 3.0 .
    After I run this simple servlet, I need to use EJB-Servlet-JSP to implement MVC .
    I have the servlet code and I am able to compile it.
    But I dont know how to proceed as to where to put the class files , where do I specify an alias for my servlet and what modifications I need in Web.xml,Jboss.xml,Application.xml ?
    I do not anything about tools like Ant or Xdoclet so need to proceed without them.Please alos let me know where I can fond complete info about Ant and Xdoclet .
    Thanx in Advance,
    Sujith

    I am not sure of the JBoss package that you are using. If you are using the JBoss-Tomcat package, here's the solution. Create either a .war file or create a directory with the name <your-webapp>.war under <jboss-root>/server/default/deploy. If you are creating a war file, you have to place that war file in the same directory. JBoss-Tomcat will keep looking at this directory for new files or updates to files and deploys/re-deploys as required.
    The contents of the war file should be something like this.
    WEB-INF - directory
    WEB-INF/classes - your servlet classes
    WEB-INF.web.xml - your configuration. Here you can specify the servlet name, class and URI mapping.
    Now, you can call your servlet using the browser in this way: http://localhost:8080/<your-webapp>/servlet/<servlet-alias>. Here the <your-webapp> is the prefix of the .war file.
    Resources:
    Ant - http://jakarta.apache.org/ant/
    Xdoclet - http://xdoclet.sourceforge.net/

  • How to run jsp and servlet using JBOSS server

    Dear Friend,
    I have JBoss application server and Eclipse id
    now i want to run JSP and Servlet but i am not getting the place where to place my servlet class file to run it .
    before that i run jsp and servlet using tomcat5.0 but in that i place my servlet class in WEB-INF/classes folder and do corresponding entry in web.xml file and run it through browser.
    now i want to use JBOSS how it is possible
    PLZ Help me

    Is the servlet class defined in a package.? If servlet class package is servlets., copy the servlet to
    WEB-INF/classes/servlets directory.

  • How to run .exe files on macbook pro

    Just bought my first macbook pro the other day.  I absolutely love it.  Much better than the windows boxes.  I wanted to run some '.exe' files on my new laptop but was not successful finding anything on the market to use without purchasing a full OS version of Windows.  Is there any software out there that I can use to run '.exe' files without purchasing a full Windows OS to do so.  I know about parallels for MAC but that seems to require purchasing Windows OS?  Any help is greatly appreciately.
    Here are the specs on my Macbook Pro.
    2.2GHz quad core i7
    4GB RAM
    500GB HDD

    Some Windows software -- not all, by a long shot -- will run on a Mac without installing Windows, with the aid of the CrossOver Mac emulator:
    http://www.codeweavers.com/products/cxmac/
    Games generally won't. For those, you need Windows installed through Boot Camp so you can run Windows natively.

  • How to Run EXE From Applet...

    Hi everyone...
    I want to run EXE from Applet ...
    I tried it .. It runs good at Normal Case...
    But when I embed it with HTML it provides Access Denied Exception...
    can anyone give me the idea for Invoking an EXE From Applets loaded in browser....

    Hi,
    Your applet must be signed.
    Hope that help,
    Jack

  • How to run .exe files with DAQ on a target PC?

    Hi,
    I want to run LabVIEW executable files on a target PC, where there is no LabVIEW installed. These files are used to do measurement using DAQ devices.
    In order to run these .exe file, I guess that I should install both LabVIEW Runtime Engine and NI-DAQmx on the target PC. Is it right?
    I'm wondering if it is mantatory to install NI-DAQmx on the target PC. I tried running .exe files without NI-DAQmx installed, but there was an error: nilvaiu.dll couldn't be found. Shouldn't this file be included automatically when building the executable files?
    Thanks,
    Qifu

    No, none of the hardware drivers are included in the LabVIEW exe that you build. You have to install DAQmx. With LabVIEW 8.x, you can include the DAQmx driver with the installer that you create. You also have the option to install different versions of DAQmx. These different versions are smaller than the full DAQmx install (i.e. you may choose to install documentation, MAX. etc.). When you create the installer, you also inclue the LabVIEW run-time and you should also choose to install the hardware configureation that is in MAX.

  • How to run exe file in cfm

    Hi all,
    Can anybody give me proper way to run exe file in
    coldfusion. I have tried with cfexecute tag but it is not
    working...
    Thanks,
    Manoj

    tclaremont wrote:
    > Are you trying to run an executable on the server, or on
    the client machine?
    > Does the CF service have execute permissions on the
    directory in question? What
    > does your error log say with regard to the attempted
    execution?
    >
    To add to all these valuable questions, what executable are
    you trying
    to run, what kind of parameters does it need? It can be a bit
    tricky to
    pass complex parameters through the <cfexecute ...>
    tag.

  • How to run .exe files using SAP

    Hi,
    How can I run my .exe files using ABAP/4 language? How can I pass parameters to my executable? Is there any documentation related with my question?
    Thanks.

    Here is how you can run a .exe from your ABAP.  I don't know how you would pass parameters.
    report zrich_0001
           no standard page heading
           line-size 300.
    data:
               ifile_table type table of file_table,
               xfile_table type file_table,
                return type i..
    parameters: p_app type file_table-filename
              default 'C:'.
    at selection-screen on value-request for p_app.
      clear ifile_table.  refresh ifile_table.
      call method cl_gui_frontend_services=>file_open_dialog
       exporting
          window_title       = 'Get App'
          multiselection     = space
       changing
          file_table         = ifile_table
          rc                 = return
       exceptions
          file_open_dialog_failed = 1
          cntl_error              = 2
          error_no_gui            = 3
          others                  = 4.
      read table ifile_table into xfile_table index 1.
      if sy-subrc  = 0.
        p_app = xfile_table.
      endif.
    start-of-selection.
      data: app type string.
      app = p_app.
      call method cl_gui_frontend_services=>execute
        exporting
          application            =  app.
    Regards,
    Rich Heilman

  • How to run .exe

    hello
    How i need to run oaj2se.exe in order to other forms windows.
    My os is OEL 5.4 pls. let me know the same.
    thanks
    Sunil

    How i need to run oaj2se.exe in order to other forms windows.
    My os is OEL 5.4 pls. let me know the same.If you mean to say you need to run oaj2se.exe on Linux then the answer is "you cannot". Linux is not certified as a client tier node -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Linux+AND+Client&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Recommended Browsers for Oracle E-Business Suite 11i [ID 285218.1]
    Recommended Browsers for Oracle E-Business Suite Release 12 [ID 389422.1]
    Thanks,
    Hussein

  • How to run JAXP in servlet using JSWDK?

    Hi,
    I am trying to parse xml to html using JAXP API within a servlet. But an error message showing ' java.lang.NoClassDefFoundError: javax/xml/parsers/ParserConfigurationException ' is displayed in the web brower. But when I parse the xml to html and output the html text to the standard output, the program works. So, how can I run xml parsers within JSWDK?
    Thanks a lot.

    Hi,
    The problem is you don't have jaxp.jar in your classpath. JAXP Package is the implementation of the specification of XML processing in Java. The xml.jar contains implementation of Sun's(called Project X) XML Parser and related utilities that does not deals with JAXP Specs. The xml.jar is meant for the JSWDK to process the xml files(configuration files). I have not found any documentations for XML Utility classes in xml.jar.
    The solution for your problem is; download JAXP api and get the jar files(3 jars) into the classpath. While setting classpath for the jars in JAXP check out that thing named crimson.jar appears first before any other jars in classpath, else it would throw a SecurityException.
    Hope this helps.
    Regards,
    Rajavelu G.

  • How to run .exe file by labview?

    Dear All,
    I want to use Labview to run a .exe file, but I don't know how to do? who can tell you? Thanks!
    Best regards,
    Jimmy

    Try the attached VI (LV v7.1.1). It uses the System Exec function:
    (from the LV Help file):
    "System Exec
    Executes a system command. UNIX You can use wildcards, pipes, and shell meta-characters. Mac OS To use this VI on Mac OS, you must have the Macintosh Programmer's Workshop installed. Refer to the Apple Developer Connection Web site for information about downloading the MPW.
    To launch an executable with options using the syntax filename.exe -option1 -option2, create a filename.bat file that calls the executable with the options syntax and use this VI to call the filename.bat file. "
    Attachments:
    Run Program.vi ‏30 KB

  • How to run Aplet under Servlet?

    Hi!
    I'am using servletrunner. I have servlet which is in C:JSKD2.0\examples\. Where should I put the *.class (this is aplet) and how to finish this code to run the aplet?
    out.println("<HTML>\n"+
    "<HEAD>\n"+
    " <TITLE>Testing...</TITLE>\n"+
    "</HEAD>\n"+
    "<BODY>\n"+
    "<CENTER>\n"+
    ???"<APPLET CODE = "fdraw.class" NAME = "fdraw" WIDTH = 640 HEIGHT = 480>???
    "</CENTER>\n"+
    "</BODY>\n"+
    "</HTML>");
    This doesn't work! It gives mi "...class fdraw not found..." Why? Can anyone help me?

    Try adding a codebase attribute to your applet tag specifying where that class should be found.
    BTW, you don't run an applet "under" a servlet. The servlet receives requests from (normally) HTTP clients. The applet resides on the server, but is downloaded by the browser via embedded HTML tags.
    Though they are both on the server, they are fundamentally different technologies. Your applet may communicate with your servlet via HTTP (or a custom protocol). But the applet does not "live under" the servlet or vice versa. One is client, and the other is server. Normally, HTTP ties them together.
    - Saish

Maybe you are looking for