I wanted to run a unix script in java application which is running in windows OS. Can any one tell how to do that with a sample code. And how to make the interaction between UNIX and windows. I am using HP UNIX. Please help me in this. Urgent.
atlantis sundar wrote:
I wanted to run a unix script in java application which is running in windows OS. Can any one tell how to do that with a sample code. And how to make the interaction between UNIX and windows. I am using HP UNIX. Please help me in this. Urgent.
Well, it would help if you tell us what are you running. You start off by saying that you are running Java on Windows, and then later say that you are using HP Unix. Well, which is it?
It can also be read as a script that works on HP, that the OP want to run on Windows... regardless, we need clarification. And more information, depending on what the clarification is.
Then you need to use a protocol like Telnet or SSH. The HP UNIX machine must have a server running for one of these; I recommend SSH over Telnet because it is more secure.
Check out Apache Commons Net for a good Telnet client, and a library like JSch for SSH.
I would recommend doing it without Java first. Can you use telnet? Or does Window need to install something like Putty? Heck.... can you even ping the HP box from the windows box?
Once you confirm that the network connection is okay, and that that a particular protocol works, then you should look into the Java API that does that protocol.