Computing.Net > Forums > Novell Netware > Please help on this!Its so basic.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Please help on this!Its so basic.

Reply to Message Icon

Name: Murali Ramaswamy
Date: September 18, 2002 at 07:52:22 Pacific
OS: Netware 5.1
CPU/Ram: SP3 version 8.77
Comment:

Hi,
Usual way of running a command like for example "version" through Java gives IO exception in readline. Please help how this can be done on netware. Code given at end. The command gets excecuted on the console and nothing went to the Process object. It is very unlike on any other platform. I would really appreciate any help.
Thanks (see code below)
-murali
import java.io.*;

public class RunCommand {

public static void main(String args[]) {

String s = null;

try {

// run the "version" command

Process p = Runtime.getRuntime().exec("version");

BufferedReader stdInput = new BufferedReader(new
InputStreamReader(p.getInputStream()));

BufferedReader stdError = new BufferedReader(new
InputStreamReader(p.getErrorStream()));

// read the output from the command

System.out.println("Here is the standard output of the command:\n");
while ((s = stdInput.readLine()) != null) {
System.out.println(s);
}

// read any errors from the attempted command

System.out.println("Here is the standard error of the command (if any):\n");
while ((s = stdError.readLine()) != null) {
System.out.println(s);
}

System.exit(0);
}
catch (IOException e) {
System.out.println("exception happened - here's what I know: ");
e.printStackTrace();
System.exit(-1);
}
}
}




Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Novell Netware Forum Home


Sponsored links

Ads by Google


Results for: Please help on this!Its so basic.

Need help on how to configure RAS on Nov www.computing.net/answers/netware/need-help-on-how-to-configure-ras-on-nov/1243.html

vol$sys.err-how to fix it-Please help me www.computing.net/answers/netware/volsyserrhow-to-fix-itplease-help-me/1926.html

Please Help --- problem during netware 4.11 installation. www.computing.net/answers/netware/please-help-problem-during-netware-411-installation/1059.html