String nm = "sun.awt.X11GraphicsEnvironment";

 grep -r JAVA_HOME /root




import java.awt.GraphicsEnvironment;
import java.security.AccessController;
import java.security.PrivilegedAction;



public class bbaa {
    
    private static Boolean headless;

    private static Boolean defaultHeadless;
    
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println(System.getProperty("javaplugin.version"));
        //System.out.println(getHeadlessProperty());
        aaa();
    }
    
    private static void aaa() {
        GraphicsEnvironment ge;
        String nm = "sun.awt.X11GraphicsEnvironment";
        Class geCls;
        try {
            System.out.println("init");
            geCls = (Class)Class.forName(nm);
            System.out.println("success");
        } catch (ClassNotFoundException ex) {
            ex.printStackTrace();
        }
    }
    
    
}


你可能感兴趣的:(it,JAVA,linux,RHEL7)