From d18f0b751fb00d869d7ee684c28958e25e057f09 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 5 Dec 2006 06:16:42 +0000 Subject: [PATCH] dont throw exception if vmware is not installed --- .../org/hyperic/sigar/vmware/VMControlLibrary.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java b/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java index 006339f3..f57d21c8 100644 --- a/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java +++ b/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java @@ -175,12 +175,17 @@ public class VMControlLibrary { out = new File(out, VMCONTROL_SO); } - setSharedLibrary(out.getPath()); + boolean exists = out.exists(); - if (out.exists()) { + if (exists) { + setSharedLibrary(out.getPath()); return; //already linked } + if (!new File(VMCONTROL_TAR).exists()) { + return; //VMware not installed + } + File dir = out.getParentFile(); if (!(dir.isDirectory() && dir.canWrite())) { throw new IOException("Cannot write to: " + dir); @@ -216,6 +221,8 @@ public class VMControlLibrary { }; exec(link_args); + + setSharedLibrary(out.getPath()); } public static boolean isLoaded() {