Advertisement
Guest User

AllLoadedNativeLibrariesInJVM.java

a guest
Nov 30th, 2011
1,866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. /***
  2.  * This class extracts all native libraries  loaded in the JVM
  3.  */
  4. public class AllLoadedNativeLibrariesInJVM {
  5.     public static void listAllLoadedNativeLibrariesFromJVM() {
  6.         ClassLoader appLoader = ClassLoader.getSystemClassLoader();
  7.         ClassLoader currentLoader = AllLoadedNativeLibrariesInJVM.class.getClassLoader();
  8.  
  9.         ClassLoader[] loaders = new ClassLoader[] { appLoader, currentLoader };
  10.         final String[] libraries = ClassScope.getLoadedLibraries(loaders);
  11.         for (String library : libraries) {
  12.             System.out.println(library);
  13.         }
  14.     }
  15.  
  16.     public static void main(String[] args) throws Exception {
  17.         listAllLoadedNativeLibrariesFromJVM();
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement