catch UnsatisfiedLinkError so we can report other version info

This commit is contained in:
Doug MacEachern 2006-07-05 23:57:48 +00:00
parent 4d7d1919bc
commit e6f646c709
1 changed files with 14 additions and 4 deletions

View File

@ -45,10 +45,7 @@ public class Version extends SigarCommandBase {
}
}
public static void printInfo(PrintStream os) {
String fqdn = getFQDN();
String host = getHostName();
private static void printNativeInfo(PrintStream os) {
String version =
"java=" + Sigar.VERSION_STRING +
", native=" + Sigar.NATIVE_VERSION_STRING;
@ -60,10 +57,23 @@ public class Version extends SigarCommandBase {
os.println("Build date.........." + build);
os.println("Archlib............." +
SigarLoader.getNativeLibraryName());
String fqdn = getFQDN();
String host = getHostName();
os.println("Current fqdn........" + fqdn);
if (!fqdn.equals(host)) {
os.println("Hostname............" + host);
}
}
public static void printInfo(PrintStream os) {
try {
printNativeInfo(os);
} catch (UnsatisfiedLinkError e) {
os.println("*******ERROR******* " + e);
}
os.println("Current user........" +
System.getProperty("user.name"));
os.println("");