Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a script from java appli

Status
Not open for further replies.

chirpyform

Programmer
Jun 20, 2003
202
FR
Hi,

I am developing a java application that runs scripts and follows the progress of the production. The problem is that the java appli is to be used with windows and the scripts are on a linux server. I have all the information necessary (user, password, directory, script, ...) but i need to be able to connect to the machine and execute the script without any interaction with the user.

Is it possible and if so how ?

Thanks in advance

Chris
 
Can you execute those scripts manually from a windows machine currently (ie, have you got a win32 version of rsh or something) ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
I tried to connect using rsh but it doesn't seem to work. I changed the .rhosts file on the machine linux and then tried "rsh address_IP -l user "pwd"" unfortunately i get an error message saying that the connection is refused.

Is it a problem linked to the way my computer creates my address IP ?

thanks

Chris
 
Thats a question for your system admins I guess ...

Basically, if you can execute your native call on your Win32 machine, then it is easy to do it in java using the Runtime and Process class.

However, if you cannot, then you need to look into some other solution such as RMI which allows you to remotely call methods, which would then invoke the desired script - but this is a lot more tricky.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top