爱比较的粉丝
我的代码
  1. public static void AddALinkedLibrary(){
  2.             System.out.println("========You're adding a dynamic link library======");
  3.             String f = System.getProperty("java.home");
  4.             System.out.println(f);
  5.             System.load(f + "\\bin\\attach.dll");
  6.             System.setProperty("com.sun.tools.attach.spi.AttachProvider",f + "\\bin\\attach.dll");
  7.             try {
  8.                 Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
  9.                 fieldSysPath.setAccessible(true);
  10.                 fieldSysPath.set(null,null);
  11.             } catch (NoSuchFieldException | IllegalAccessException e) {
  12.                 e.printStackTrace();
  13.             }
  14.             System.out.println("========Congratulations on your successful addition of the Dynamic Link library======");
  15.         }
复制代码
不知道为什么没有用

第一页 上一页 下一页 最后一页