From e6f646c70929be5c83f6d57f877d1117633ab746 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 5 Jul 2006 23:57:48 +0000 Subject: [PATCH] catch UnsatisfiedLinkError so we can report other version info --- .../src/org/hyperic/sigar/cmd/Version.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/bindings/java/src/org/hyperic/sigar/cmd/Version.java b/bindings/java/src/org/hyperic/sigar/cmd/Version.java index 0636dc3e..4ea07120 100644 --- a/bindings/java/src/org/hyperic/sigar/cmd/Version.java +++ b/bindings/java/src/org/hyperic/sigar/cmd/Version.java @@ -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("");