/** * Loads a specific jar from a path * @param arg the path to the jar * can be a file, a string path or an URL * @return true if success, false if failed */ public static boolean load_jar(Object arg){ try { if ( arg instanceof String) { ClassLoaderUtil.addFileToClassPath(new File(arg.toString()), ClassLoaderUtil.getDefaultClassLoader()); return true; } if ( arg instanceof File) { ClassLoaderUtil.addFileToClassPath((File)arg, ClassLoaderUtil.getDefaultClassLoader()); return true; } if ( arg instanceof URL){ ClassLoaderUtil.addUrlToClassPath((URL) arg, ClassLoaderUtil.getDefaultClassLoader()); return true; } return false; }catch (Exception e){ System.err.println(e); } return false; }
.hasNext();) { File jarFile = it.next(); ClassLoaderUtil.addFileToClassPath(jarFile, this.getClass().getClassLoader()); ClassLoaderUtil.addFileToClassPath(getBinDirectory(), this.getClass().getClassLoader());