user964819
user964819

Reputation: 353

Executing java main class on a remote server using Ant

I need to copy some .class files to a remote server and execute the main class file using ANT script. I 'm able to copy the files using the SCP ant target ,but i'm stuck on which task to execute for running the main class on a remote server.The main class also accepts couple of arguments for execution as well.Can anyone provide any pointers on how to achieve the same.

Upvotes: 1

Views: 542

Answers (1)

ericson
ericson

Reputation: 1658

Have you tried SSHEXEC?

<sshexec host="somehost"
username="dude"
password="yo"
command="java YourClass args"/>

JRE installation is required on the remote server.

Upvotes: 1

Related Questions