No. You should be doing something like this:
Process process = Runtime.getRuntime().exec("your command");
// Now read/write data with the PROCESS streams!
I suggested it last August, and I'm suggesting it again now: if you want to interact with your server remotely (as I believe it sounded like you wanted to do back then), and you want to program your logic in Java, then I *strongly* urge you to consider using Apache/Tomcat.