This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I want to execute a linux script from my java program residing on a windows machine. Can anybody help me in this regard? I can use the other tools like telnet to connect to linux machine and execute scripts but I would like to do it from the java program without going through the tools. Appreciate your suggestions
A Java application can use Telnet programmatically through a library like Apache Commons Net. That would be one way.
Another would be to run a servlet (or some kind of server-side web component) on the Linux box that starts the script using ProcessBuilder or Runtime.exec. The Java app could then start it by accessing a particular URL.