How do I find out all the installed packages?

John Zukowski

You cannot find out the installed packages. You can find out the packages with loaded classes with the help of the Package class. The following displays the loaded packages as well as their vendor and version information:

class PackageList {
  public static void main (String args[]) {
    Package packages[] = Package.getPackages();
    for (int i=0, n=packages.length; i<n; i++) {
      System.out.println(
        packages[i].getName() + ": " +
        packages[i].getImplementationTitle() + " / " +
        packages[i].getImplementationVendor() + " / " +
        packages[i].getImplementationVersion());
    }
  }
}

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact