catch UnsatisfiedLinkError so we can report other version info
This commit is contained in:
		
							parent
							
								
									4d7d1919bc
								
							
						
					
					
						commit
						e6f646c709
					
				@ -45,10 +45,7 @@ public class Version extends SigarCommandBase {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void printInfo(PrintStream os) {
 | 
					    private static void printNativeInfo(PrintStream os) {
 | 
				
			||||||
        String fqdn = getFQDN();
 | 
					 | 
				
			||||||
        String host = getHostName();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        String version =
 | 
					        String version =
 | 
				
			||||||
            "java=" + Sigar.VERSION_STRING +
 | 
					            "java=" + Sigar.VERSION_STRING +
 | 
				
			||||||
            ", native=" + Sigar.NATIVE_VERSION_STRING;
 | 
					            ", native=" + Sigar.NATIVE_VERSION_STRING;
 | 
				
			||||||
@ -60,10 +57,23 @@ public class Version extends SigarCommandBase {
 | 
				
			|||||||
        os.println("Build date.........." + build);
 | 
					        os.println("Build date.........." + build);
 | 
				
			||||||
        os.println("Archlib............." +
 | 
					        os.println("Archlib............." +
 | 
				
			||||||
                   SigarLoader.getNativeLibraryName());
 | 
					                   SigarLoader.getNativeLibraryName());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        String fqdn = getFQDN();
 | 
				
			||||||
 | 
					        String host = getHostName();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        os.println("Current fqdn........" + fqdn);
 | 
					        os.println("Current fqdn........" + fqdn);
 | 
				
			||||||
        if (!fqdn.equals(host)) {
 | 
					        if (!fqdn.equals(host)) {
 | 
				
			||||||
            os.println("Hostname............" + host);
 | 
					            os.println("Hostname............" + host);
 | 
				
			||||||
        }        
 | 
					        }        
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    public static void printInfo(PrintStream os) {
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            printNativeInfo(os);
 | 
				
			||||||
 | 
					        } catch (UnsatisfiedLinkError e) {
 | 
				
			||||||
 | 
					            os.println("*******ERROR******* " + e);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        os.println("Current user........" +
 | 
					        os.println("Current user........" +
 | 
				
			||||||
                   System.getProperty("user.name"));
 | 
					                   System.getProperty("user.name"));
 | 
				
			||||||
        os.println("");
 | 
					        os.println("");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user