Results 1 to 5 of 5
Thread: connecting to a server
- 02-11-2010, 07:12 PM #1
Member
- Join Date
- Jul 2008
- Posts
- 11
- Rep Power
- 0
connecting to a server
hey guys....i want to connect to a server and then perform a series of bash commands such as ls , cd etc... my end objective is to a run a particular script located on the server from a java applet....can u please provide some help on how to connect to a server and how to use these bash commands...
- 02-11-2010, 07:29 PM #2
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
Hello
you can find solution in this article:
Running system commands in Java applications | java exec example | devdaily.com
For execution on remote machines check the comments at the bottom
of that article and links there.
So first thing is to get to know how to run external command on local machine:
And second - remote machine execution - can be some Socket client/server solutionJava Code:Process p = Runtime.getRuntime().exec("my command");
cheers!
- 02-12-2010, 03:33 PM #3
Member
- Join Date
- Jul 2008
- Posts
- 11
- Rep Power
- 0
can i write the ruby script for the server in shell script?
Last edited by paddala; 02-12-2010 at 03:48 PM.
- 02-12-2010, 10:22 PM #4
Member
- Join Date
- Aug 2009
- Posts
- 76
- Rep Power
- 0
A rest call would certainly be one way. But if you are going to be doing simple command line operations there really isn't a good reason to set up a server. I personally use
JSch - Java Secure Channel
when I want to simply run command line operations on a remote server. Its very useful for running a shell script like you mentioned. It does take some tweaking of the examples to get correct, but I didn't have much of a problem programming it to my needs.
- 02-16-2010, 07:40 PM #5
Member
- Join Date
- Jul 2008
- Posts
- 11
- Rep Power
- 0
one more question....i m creating an applet and i dont want the different dialog boxes to show up....so i have a set default username and password but authentication fails every time....also i cant view the stack trace of the JSch exception....can u help me out on this one?
thanks a lot senorbum....that link was very helpful :)Last edited by paddala; 02-16-2010 at 08:22 PM.
Similar Threads
-
Connecting to Server Application
By andre1011 in forum NetworkingReplies: 1Last Post: 10-29-2009, 07:29 AM -
connecting to remote SQL server
By mahasarathi in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 04-04-2009, 06:11 AM -
Applet connecting to server
By zenMarko in forum Java AppletsReplies: 1Last Post: 11-15-2008, 04:32 PM -
Connecting To SQL Server
By rmaadil in forum JDBCReplies: 7Last Post: 08-20-2008, 05:53 PM -
Connecting to a Web server
By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 07:57 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks