add dir where sigar.jar lives to search path

This commit is contained in:
Doug MacEachern 2004-07-01 01:09:23 +00:00
parent 5df1139c53
commit 6caf990fc8
1 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,8 @@ import java.lang.reflect.InvocationTargetException;
import java.net.URLClassLoader; import java.net.URLClassLoader;
import java.net.URL; import java.net.URL;
import net.hyperic.sigar.SigarLoader;
public class Runner { public class Runner {
private static HashMap wantedJars = new HashMap(); private static HashMap wantedJars = new HashMap();
@ -121,7 +123,10 @@ public class Runner {
String[] pargs = new String[args.length - 1]; String[] pargs = new String[args.length - 1];
System.arraycopy(args, 1, pargs, 0, args.length-1); System.arraycopy(args, 1, pargs, 0, args.length-1);
String[] dirs = { "lib", "." }; String sigarLib =
new SigarLoader(SigarLoader.class).findJarPath("sigar.jar");
String[] dirs = { sigarLib, "lib", "." };
for (int i=0; i<dirs.length; i++) { for (int i=0; i<dirs.length; i++) {
if (addJarDir(dirs[i])) { if (addJarDir(dirs[i])) {
break; break;