Executing Batch files from Runtime.getRuntime().exec

Can we execute batch files from Runtime.getRuntime().exec() method.
Regards,
Nalini

hi,
import java.io.IOException;
class BatchFileTest{
     public static void main(String args[]){
          try{
          Runtime r = Runtime.getRuntime();
          Process p = r.exec("startcmd.bat");
          catch(IOException en){
               en.printStackTrace();
-Regards
Manikantan

Similar Messages

  • Executing batch file from Java stored procedure hang

    Dears,
    I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
    public static String runFile(String drive)
    String result = "";
    String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
    try {
    File directory = new File(drive + ":");
    File file = File.createTempFile("bb1", ".bat", directory);
    file.deleteOnExit();
    FileWriter fw = new java.io.FileWriter(file);
    fw.write(content);
    fw.close();
    // The next line is the command causing the problem
    Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = input.readLine()) != null)
    result += line;
    input.close();
    file.delete();
    result = result.substring( result.lastIndexOf( ' ' )).trim();
    } catch (Exception e) {
    e.printStackTrace();
    result = e.getClass().getName() + " : " + e.getMessage();
    return result;
    The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
    I gave the SYSTEM schema the required privilege to execute the code.
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    GRANT JAVAUSERPRIV TO SYSTEM;
    I have used the following to load the class in Oracle 9ir2 DB:
    loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
    CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
    I have seen similar problems on other forums, but no solution posted
    [http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
    I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
    Can anyne help?

    Dear Peter,
    You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
    I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
    The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
    The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
    where content of bb1.bat as follows:
    echo off
    vol C: | find /i "Serial Number is"
    The above batch file just get the serial number of hard drive assigned when windows formatted HD.
    Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    Never returns
    Thanks for tracing teh issue to that details ;) hope you coul help.

  • How to execute batch file from JSP

    hi frens !
    i wanna know how to execute batch file from my JSP.i am using exec() method to get call the batch file. but its not working ....plz help
    here mine code:-
    File F = new File("C:/var.bat");
         try{
          if (F.exists())
            Runtime rt = Runtime.getRuntime();
            String url=F.getAbsolutePath();
             Process proc = rt.exec(url);
            proc.waitFor();
            proc.destroy();
            catch(Exception IOEx){
           System.out.println(IOEx);
      }Thanks and Regards
    Allwyn

    You might improve your chances of getting help if you do two things:
    1) Explain what "not working" means.
    2) ChangeSystem.out.println(IOEx); to IOEx.printStackTrace(); (in the eventhat is in fact related to "not working").

  • Executing batch files from websevice using ODI OS Command

    Hi,
    Is it possible to execute the batch files using odi os command from webservices.
    We have developed a webservice, which passess some parameters to one batch file and after that we executing the same batch file in package using odi os command. In opeartor is showing as running, it never ends.
    But if we run the same package from designer, it is executing successfully. Also the same web service is working fine for executing non batch scenarios.
    what could be the problem??
    We got one possible reason for failure...
    For executing the batch from web services, we need read and executable permissions on the drive where batch sits.
    We are logging into ODI using SUPERVISOR. How to give the permissions to SUPERVISOR as we are having windows authentication.
    Edited by: Naveen Suram on Dec 17, 2009 8:07 PM
    As a work around, can we use ODIOSCommand instead of OS Command. But it is asking for starting event? Whether both the commands does the same functionality??
    Edited by: Naveen Suram on Dec 17, 2009 9:08 PM

    From the FAQ:
    2. How do you launch an external program on a Microsoft Windows platform from a program developed on the Java [tm] programming language?
    The following will launch notepad in Microsoft Windows NT:
    Runtime.getRuntime().exec("cmd /c notepad.exe");
    To launch a program in Microsoft Windows 95/98 use:
    Runtime.getRuntime().exec("c:\\windows\\notepad.exe");
    The Runtime class allows interaction between a program and its environment. The first string command instructs the command line interpretor, cmd to open up the calculator application.
    The exec() methods do not use a shell; any arguments must have the full pathname to the shell as well as the command itself.
    For example, to run a shell on the UNIX� platform, type:
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec("/usr/bin/sh -c date");
    To run a batch file under Microsoft Windows 95/98:
    Process p = rt.exec("command.com /c c:\\mydir\\myfile.bat");
    To run a batch file under Microsoft Windows NT:
    Process p = rt.exec("cmd /c c:\\mydir\\myfile.bat");
    where 'cmd' and 'command.com' are the command-line interpreters for Microsoft Windows machines.
    The Runtime.exec() methods might not work effectively for some processes on certain platforms. Special care should be taken with native windowing, daemon, WIN16/DOS process or some shell scripts.
    regards,
    jarshe

  • Running batch files  from Java using exec method

    Hi,
    I want to run a batch file from my Java program like this:
    try {
    Process proc = Runtime.getRuntime().exec("C:\\Refresh.bat");
    catch (Exception e) {
    MessageBox.show(e.getMessage());
    Refresh.bat file contains two commands.
    First one unzips certain zip file.
    Second one refreshes a SQL Server database using osql utility.
    Problem is that when program is run it executes only the first command and hangs on the second one.
    Please help.
    TIA
    Ravinder

    From the FAQ:
    2. How do you launch an external program on a Microsoft Windows platform from a program developed on the Java [tm] programming language?
    The following will launch notepad in Microsoft Windows NT:
    Runtime.getRuntime().exec("cmd /c notepad.exe");
    To launch a program in Microsoft Windows 95/98 use:
    Runtime.getRuntime().exec("c:\\windows\\notepad.exe");
    The Runtime class allows interaction between a program and its environment. The first string command instructs the command line interpretor, cmd to open up the calculator application.
    The exec() methods do not use a shell; any arguments must have the full pathname to the shell as well as the command itself.
    For example, to run a shell on the UNIX� platform, type:
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec("/usr/bin/sh -c date");
    To run a batch file under Microsoft Windows 95/98:
    Process p = rt.exec("command.com /c c:\\mydir\\myfile.bat");
    To run a batch file under Microsoft Windows NT:
    Process p = rt.exec("cmd /c c:\\mydir\\myfile.bat");
    where 'cmd' and 'command.com' are the command-line interpreters for Microsoft Windows machines.
    The Runtime.exec() methods might not work effectively for some processes on certain platforms. Special care should be taken with native windowing, daemon, WIN16/DOS process or some shell scripts.
    regards,
    jarshe

  • Inconsistent exit code from Runtime.getRuntime().exec

    I'm getting non-deterministic behavior from a call to a native process. Here is the code:
    public class Test {
    public static void main (String[] pArgs) {
    try {
    String cmd[] = { "cmp", "-s",
    pArgs[0],
    pArgs[1] };
    System.err.println("running command: ");
    Process p = Runtime.getRuntime().exec(cmd);
    System.err.println("getting exitcode...");
    int exitcode = p.waitFor();
    System.err.println(exitcode);
    System.err.println(p.exitValue());
    } catch(Exception e) {
    System.err.println("Caught exception while executing cmd");
    e.printStackTrace();
    And here is the output:
    bock@homeruns[~/work/index]10:08> java Test output output.old
    running command:
    getting exitcode...
    0
    0
    bock@homeruns[~/work/index]10:08> java Test output output.old
    running command:
    getting exitcode...
    1
    1
    bock@homeruns[~/work/index]10:08> java Test output output.old
    running command:
    getting exitcode...
    0
    0
    they should all be 1's because the files are different. when i run it on the command line i get:
    bock@homeruns[~/work/index]10:13> cmp -s output output.old ; echo $?
    1
    any help would definitely be appreciated!
    thanks,
    roger

    thanks for the link. i read through it but it doesn't seem to address why the exit code would be inconsistently reported. the other problems described by that link don't seem to apply to this case because i have not experienced hanging and there is no standard input, standard output, or standard error associated with "cmp -s" - all it does is return the appropriate exit code.
    should i be reporting this as a bug to sun? up till recently i've been assuming it was a problem with my code but now i'm not so sure...

  • InputStream hung from Runtime.getRuntime().exec

    Dear all,
    I am trying to use the following code to run a Runtime.getRuntime().exec("my_selection.exe") method and redirect all the output from the process to my JTextArea.
    My program is an executable called "my_selection.exe", which runs under DOS something like:
    My Selection Utilities:
    type the command -
    o : open an item
    l : list subitems
    q : exit
    Please select your options:But when I run my Test program, the above selection menu does not show in my JTextArea. Only after I type q (which is exit command in my_selection), will all the output shown in TextArea.
    I tested the inputstream.available(), but it always == 0.
    Anyone can help point me out what is wrong here?
    BTW, when I use the same program to run "copy a.txt a" by exec("cmd.exe"), it works ok, no matter whether it prompts for owerwrite the existing file or not.
    Many thanks!
    I tried the code,
    /* part of the code */
    public static void main(String[] args) {
         Test t = new Test();
         t.setTitle("Basic GUI");
         t.init(); // init GUI
         t.connect();
         t.show();
    private static void log(Object text) {
         getTextArea().setCaretPosition(getTextArea().getText().length());
         getTextArea().setText(getTextArea().getText() + text.toString() + "\n");
    private Thread getInputStreamListener() {
         if(listener == null) {
              Runnable runnable = new Runnable() {
                   public void run() {
                        try {
                             String text = "";
                             while (true) {
                                  while (inputStream.available()==0) {
                                       Thread.currentThread().sleep(100);
                                  byte[] bytes = new byte[inputStream.available()];
                                  inputStream.read(bytes);
                                  text = new String(bytes);
                                  log("> " + text);
                        catch(Exception e) {
                             handleException(e);
              listener = new Thread(runnable);
              listener.setName("out listener");
              listener.setPriority(2);
              listener.start();
         return listener;
    private Thread getErrorStreamListener() {
         if(listener == null) {
              Runnable runnable = new Runnable() {
                   public void run() {
                        try {
                             String text = "";
                             while (true) {
                                  while (errorStream.available()==0) {
                                       Thread.currentThread().sleep(100);
                                  byte[] bytes = new byte[errorStream.available()];
                                  errorStream.read(bytes);
                                  text = new String(bytes);
                                  log("> " + text);
                        catch(Exception e) {
                             handleException(e);
              listener = new Thread(runnable);
              listener.setName("out error listener");
              listener.setPriority(2);
              listener.start();
         return listener;
    private static void handleException(Throwable t) {
         log(t);
    private void connect() {
         try{
              process = Runtime.getRuntime().exec(new String[] {"my_selection.exe"});
              inputStream = new BufferedInputStream(process.getInputStream());
              outputStream = new BufferedOutputStream(process.getOutputStream());
              errorStream = new BufferedInputStream(process.getErrorStream());
              getInputStreamListener();
              getErrorStreamListener();
         catch(Exception e) {
              log(e);

    Note in the above code all "listener" variable in:
    private Thread getErrorStreamListener() method
    show be "listener1".
    Even I changed it, it does not work either.
    Please help.
    Thanks!

  • Executing a command by Runtime.getRuntime.exec().

    Hi,
    I am try to run a java command from one java program. Is it possible
    eg :
    public class A {
    public static void main(String[] args) {
    String startjvm ="java -classpath E:\classes B";
    Runtime.getRuntime.exec(startjvm);
    public class B {
    public static void main(String[] args) {
    System.out.println("Inside the main for class B");
    when i execute the above command from the command line it executes,but when are run the main method for class A nothing happens meaning the message : "Inside the main for class B" is not displayed.
    I also tried displaying the int returned by process.waitfor() method. process is the object returned by the Runtime.getRuntime.exec() method. The int returned is 0 which means the process terminated previously.
    Thanks in advance

    You could get InputStream from created Process and read
    information from it.
    For example
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    public class A {
        public static void main(String[] args) {
            try{
                String startjvm ="java -classpath E:\\classes B";
                Process s = Runtime.getRuntime().exec(startjvm);
                BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
                String line = "";
                while ((line = in.readLine()) != null) {
                    System.out.println(line);
                in.close();
            }catch(Exception e){
                e.printStackTrace();
        }

  • Executing batch File from Jsp

    I want to execute a batch file which is located at d:\build from a jsp
    I also want to give parameters to batch file.
    Actually my batch file is demo.bat and i want to execute this command via jsp
    demo Compile dev

    in a word - don't. that's not what jsps are for.
    you sound confused about where jsps actually run. get client and server straight in your head and then think about it again.
    %

  • Execute Batch Files, DOS Commands etc. from my Java Application

    Can someone show me how it works?
    I dont need any return values, just execute a Batch File or a Command
    Thx, Guardian

    Hi Luke,
    Just wanna add 2 things to what you've written. (your sample code)
    Point 1pro.waitFor(); should be called before attempting the read anything from the process' InputStream if you don't want to lose anything your process might print out. When Runtime.getRuntime.exec("your_command") is executed, the resulting process is just another runaway thread unless you tell you calling thread to wait for this process to end before proceeding further. This is where waitFor() comes in.
    Point 2Runtime.getRuntime().exec("C:\\command.com /C mybat.bat"); works but it is pretty platform dependent. If you need to write platform independent stuff, you could just drop the command.com stuff and go right to the batch file or the command you need to execute. I've managed to just survive with Runtime.getRuntime().exec("mybat.bat");Regards,
    Noel

  • PROBLEM in executing a shell command through Runtime.getRuntime().exec()

    Hi all,
    I was trying to execute the following code:
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.Statement;
    import java.sql.ResultSet;
    * Created on Mar 13, 2007
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    * @author 195092
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    public class ClassReportDeleteDaemon {
         ClassReportDeleteDaemon()
         public static void main(String[] args) throws Exception
              Connection conn = null;
              Statement stmt = null;
              ResultSet rs;
              String strQuery = null;
              String strdaysback = null;
              String delstring = null;
              int daysback;
              try
                   System.out.println("REPORT DELETION ::: FINDING DRIVER");               
                   Class.forName("oracle.jdbc.driver.OracleDriver");
              catch(Exception e)
                   System.out.println("REPORT DELETION ::: DRIVER EXCEPTION--" + e.getMessage());
                   System.out.println("REPORT DELETION ::: DRIVER NOT FOUND");
              try
                   String strUrl = "jdbc:Oracle:thin:" + args[0] + "/" + args[1] + "@" + args[2];
                   System.out.println("REPORT DELETION ::: TRYING FOR JDBC CONNECTION");
                   conn = DriverManager.getConnection(strUrl);
                   System.out.println("REPORT DELETION ::: SUCCESSFUL CONNECTION");
                   while(true)
                        System.out.println("WHILE LOOP");
                        stmt = conn.createStatement();
                        strQuery = "SELECT REP_DAYS_OLD FROM T_REPORT_DEL";
                        rs = stmt.executeQuery(strQuery);
                        while(rs.next())
                             strdaysback = rs.getString("REP_DAYS_OLD");
                             //daysback = Integer.parseInt(strdaysback);
                        System.out.print("NO of Days===>" + strdaysback);
                        delstring = "find /tmp/reports1 -name " + "\"" + "*" + "\"" + " -mtime +" + strdaysback + " -print|xargs rm -r";
                        System.out.println("DELETE STRING===>" + delstring);
                        Process proc = Runtime.getRuntime().exec(delstring);
                        //Get error stream to display error messages encountered during execution of command
                        InputStream errStream=proc.getErrorStream();
                        //Get error stream to display output messages encountered during execution of command
                        InputStream inStream = proc.getInputStream();
                        InputStreamReader strReader = new InputStreamReader(errStream);
                        BufferedReader br = new BufferedReader(strReader);
                        String strLine = null;
                        while((strLine=br.readLine())!=null)
                             System.out.println(strLine);
                   }     //end of while loop
              }     //end of try
              catch (Exception e)
                   System.out.println("REPORT DELETION ::: EXCEPTION---" + e.getMessage());
                   conn.close();
         }     //end of main
    }     //end of ClassReportDeleteDaemon
    But it is giving the error "BAD OPTION -print|xargs". The command run well in shell.
    Please help.
    Thanking u.......

    Since the pipe '|' is interpreted by the shell then you need the shell to invoke your command
            String[] command = {"sh","-c","find /tmp/reports1 -name " + "\"" + "*" + "\"" + " -mtime +" + strdaysback + " -print|xargs rm -r"};
            final Process process = Runtime.getRuntime().exec(command);
      You should also read http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html at least twice and implement the recommendation regarding stdout and stderr.
    P.S. Why are you not using Java to find and delete these files?
    Message was edited by:
    sabre150

  • Unable to execute Runtime.getRuntime().exec(

    Hello,
    I am new to Java programming and trying to execute (OS is Linux) an external jar File with the command:
    Runtime.getRuntime().exec("nohup java -jar SeismicAgents.jar &");It should start the SeismicAgents.jar and write the output to nohup.out.
    This works perfectly if I just enter the command at the command line.
    But upon starting it from within my program, the process seems to be started (I can see it when executin "ps aux"), but it is obviously not running as no input is written to nohup.out and the file which SeismicAgents.jar should generate is not generated.
    I also tried the following code:
    String cmd[] = {"nohup", "java", "-jar", "SeismicAgents.jar", "&"};
    Runtime.getRuntime().exec(cmd);But I am experiencing the same problem here.
    Executing something like
    Runtime.getRuntime().exec(ls);works without problems...
    Can anyone help?

    Runtime.getRuntime().exec("nohup java -jar
    SeismicAgents.jar &");Java does not interprete the '&' character. Neither does
    nohup. You would have to prefix this with /bin/sh -c, put
    the rest in quotes and, most importantly, redirect input
    and output somewhere. Without redirection, it is the task
    of your java program to feed the subprocess with input
    and drain its stdout and stderr buffers.
    Executing something like
    Runtime.getRuntime().exec(ls);works without problems...It is hard to believe this. Either it should be "ls" or
    ls is string variable containing the relevant string,
    but even then I would be surprised if you see any
    output on the command line. At least I don't get
    anything with public class bla {
      public static void main(String[] argv) throws Exception {
        Runtime.getRuntime().exec("ls");
    }If you don't want a "/bin/sh -c" hack, you may want to
    try http://www.ebi.ac.uk/~kirsch/monq-doc/monq/stuff/Exec.html .
    Harald.

  • Executing a batch file from a jsp

    hi,
    i have a jsp running on tomcat 3.1
    now upon submit, i want a batch file to execute .
    how do i do that..( i mean what will be the correct syntax for this ) say the batch file exists in /tomcat/batch/ do i have to give the abosolute path for this or a relative path will do.. ( if the relative path works then, do i have to mention a context for the batch directory in server.xml..
    pls help.. this is urgent
    thanx

    Hi truptip,
    This is the code to execute a batch file or any system command,
    Process p = Runtime.getRuntime().exec("shell command you want to exit");
    p.waitFor();
    In regards to whether you should access it using a relative location, the answer is no. Execution of a batch file is not part of the the webserver, so the webserver's concept of the current directory for the client does not apply.
    On a side note I wanted to say that I would highly recommend that you don't put the batch files anywhere on the webserver that is accessible to the user, not that the webserver would execute the code, but it may let out some information that you don't want available.
    Hope this is of some help,
    James

  • Executing two commands at the same time from Runtime.getRuntime

    Hi everybody,
    I m executing a command of imageMagic from javacode to crop and for changing the quality of image.The code is as below :
    String changeQuality = new String("convert " + originalImage
                        + " -crop " + imageWidth + "x" + imageHeight + "+" + imageX
                        + "+" + imageY + " -quality " + quality + " " + finalImage);
                   Runtime.getRuntime().exec(changeQuality);
    But before going to next page of jsp I want the size of the finalImage. So I m calling a new function from the base file, from which i m calling the above function, for getting the size of image:
    public String getSize(String finalImage) {
                   proc = Runtime.getRuntime().exec("identify " + finalImage);
    As identify cmd gives the size and various values of image but this command is showing the size zero. and if try to read the file then it shows FileNotFoundException.It means the file is not on the server.
    What should i do to execute both the command and getting the right result.
    Any help is appreciated.
    Thanks in advance.
    Vivek Kumar Gupta

    Hi everyone,
    Nobody ans my question but finally i got the ans of my question.
    I use a input stream for reading the first one imagemagic command. through this the second command execute after the first command finished its execution.
    And my images are now displaying without error.
    I know now you all are thinking how great mind I am!!! hai na
    Hmm woh to main hoon.
    post a question if u have over here. Perhaps i can solve your prob.

  • How to execute an application in Solaris using Runtime.getRuntime.exec() ?

    I am currently doing a project which requires the execution of Solaris applications through the use of Java Servlet with this Runtime method - Runtime.getRuntime.exec()
    This means that if the client PC tries to access the servlet in the server PC, an application is supposed to be executed and launched on the server PC itself. Actually, the servlet part is not an issue as the main problem is the executing of applications in different platforms which is a big headache.
    When I tried running this program on a Windows 2000 machine, it works perfectly fine. However, when I tried it on a Solaris machine, nothing happens. And I mean nothing... no errors, no nothing. I really don't know what's wrong.
    Here's the code.
    public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException, IOException
         response.setContentType("text/html");
         PrintWriter out = response.getWriter();
              Process process;                                                       Runtime runtime = Runtime.getRuntime();
              String com= "sh /opt/home/acrobat/";
              String program = request.getParameter("program");
              try
                        process = runtime.exec(com);
              catch (Exception e)
                   out.println(e);
    It works under Windows when com = "c:\winnt\system32\notepad.exe"
    When under Solaris, I have tried everything possible. For example, the launching of the application acrobat.
    com = "/opt/home/acrobat"
    com = "sh /opt/home/acrobat"I have also tried reading in the process and then printing it out. It doesn't work either. It only works when excuting commands like 'ls'
    BufferedReader read = new BufferedReader(new InputStreamReader(process.getInputStream()));Why is it such a breeze to execute prgrams under Windows while there are so many problems under Solaris.
    Can some experts please please PLEASE point out the errors and give me some advice and help to make this program work under Solaris! Please... I really need to do this!!
    My email address - [email protected]
    I appreciate it.
    By the way, I'm coding and compiling in a Windows 2000 machine before ftp'ing the .class file to the Solaris server machine to run.

    it is possible that you are trying to run a program that is going to display a window on an X server, but you have not specified a display. You specifiy a display by setting the DISPLAY environment variable eg.
    setenv DISPLAY 10.0.0.1:0
    To check that runtime.exec is working you should try to run a program that does not reqire access to an X Server. Try something like
    cmd = "sh -c 'ls -l > ~/testlist.lst'";
    alternatively try this
    cmd = "sh -c 'export DISPLAY=127.0.0.1:0;xterm '"
    you will also need to permit access to the X server using the xhost + command

Maybe you are looking for

  • DFM 3.2 email notifications have stopped

    Good day. We're running LMS 3.2 with DFM 3.2, and at some point within the last month, email notifications from DFM have stopped flowing.  DFM is trapping events as they occur and these are viewable through the portal, but notifications that should b

  • SAP BI 7.0 Transport issue with HR Structural Authorization DSO

    Hi, I am trying to transport HR Structural Authorization DSO Objects in  BI 7.0  from Dev to QA system. The Data sources are 0PA_DS02 and 0PA_DS03. ( I am sure that there are lots of changes in Authrorization concept in BI 7.0),. 1. Please suggest me

  • How to connect to wifi with ios6?

    Neither my iPhone or iPad will work after the software install. Any ideas?

  • Error 404 : page not found

    hi all i try to make like this demo: http://download.oracle.com/otn_hosted_doc/jdeveloper/11/demos/overview/JDeveloperOverview.html i do very thing like it except the change in JavaServiceFacade becaus I don't add any query, only I want insert some d

  • Icon battery

    The icon on top right is white on home screen but green in safari & other apps. What should I do? Can I fix or exchange? Thanks.