dcsimg
Problem running an executable on Unix
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, July 19, 2001 10:25 AM

I have a class which uses the .getRuntime().exec method to run an executable which sits on Unix. I get an IOException CreateProcess thrown. It works on Win2000 though? Below is the code:- arguments[0] = "/users/oracle/9ias/6iserver/bin/rwcli60"; arguments[1] = "userid=user/password@db"; Runtime.getRuntime().exec(arguments); Here is the error message:- java.io.IOException: CreateProcess: error=3 at java.lang.Win32Process.create(Native Method) at java.lang.Win32Process. (Win32Process.java:66) at java.lang.Runtime.execInternal(Native Method) at java.lang.Runtime.exec(Runtime.java:551) at java.lang.Runtim   More>>

I have a class which uses the .getRuntime().exec method to run an executable which sits on Unix. I get an IOException CreateProcess thrown. It works on Win2000 though?

Below is the code:-

			
arguments[0] = "/users/oracle/9ias/6iserver/bin/rwcli60";
arguments[1] = "userid=user/password@db";
Runtime.getRuntime().exec(arguments);


Here is the error message:-

			
java.io.IOException: CreateProcess:
error=3
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process. (Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:551)
at java.lang.Runtime.exec(Runtime.java:477)
at java.lang.Runtime.exec(Runtime.java:443)


I have tried other methods but keep getting the exception thrown.    <<Less

Re: Problem running an executable on Unix

Posted By:   Nathan_Meyers  
Posted On:   Thursday, July 19, 2001 07:29 PM

The Runtime.exec() method executes a command on the host machine - just as if you'd typed that command into the host's command interpreter. If you can't run that command by typing it into the DOS command window, then you can't run it by passing it to Runtime.exec(): there's no magic for making the command run on a different machine.


If you're looking for a way to run a command remotely, you need some sort of server running on the remote machine (a Web server, an RMI server, an ssh server, an rsh server, or whatever), and you need to run a client on your local machine that knows how to ask the remote machine for the required service.

About | Sitemap | Contact