-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackageInfo.java
More file actions
27 lines (24 loc) · 1014 Bytes
/
Copy pathPackageInfo.java
File metadata and controls
27 lines (24 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class PackageInfo{
public static void main(String[] args){
if(args.length == 0){
System.err.println("usage: java PackageInfo packageName [version]");
return;
}
Package pkg = Package.getPackage(args[0]);
if(pkg == null){
System.err.println(args[0] + " not found.");
return;
}
System.out.println("Name: " + pkg.getName());
System.out.println("Implementation title: " + pkg.getImplementationTitle());
System.out.println("Implementation vendor: " + pkg.getImplementationVendor());
System.out.println("Implementation version: " + pkg.getImplementationVersion());
System.out.println("Specification title: " + pkg.getSpecificationTitle());
System.out.println("Specification vendor: " + pkg.getSpecificationVendor());
System.out.println("Specification version: " + pkg.getSpecificationVersion());
System.out.println("Sealed: " + pkg.isSealed());
if(args.length>1){
System.out.println("Compatible with " + args[1] + ": " + pkg.isCompatibleWith(args[1]));
}
}
}