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() {