How to execute a unix script from a java app ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, November 16, 2006 09:32 AM

Hi - I have a java program running in a windows environment. I need to execute a unix script in a different machine through my java application. My java app is a web application.

If anyone have any idea please help me with a sample code.

Thanks a lot in advance.

Cheers
Chimbu.

Re: How to execute a unix script from a java app ?

Posted By:   Anonymous  
Posted On:   Friday, November 17, 2006 05:04 AM

I would use Ant's . Just add the ant.jar and jsch.jar to your applications classpath, instantiate org.apache.tools.ant.taskdefs.optional.ssh.SSHExec and feet that with the needed data. Then invoke execute(). So basically: use Ant as an class library ;-)
About | Sitemap | Contact