package com.headius.invokebinder;

/**
 * Created by headius on 6/27/17.
 */
public class Util {
    public static boolean isJava9() {
        try {
            return System.getProperty("java.specification.version", "").equals("9");
        } catch (Exception e) {
            return false;
        }
    }
}

package com.headius.invokebinder;

/**
 * Utilities used by InvokeBinder classes.
 */
public class Util {
    public static boolean IS_JAVA9;

    static {
        boolean isJava9;
        try {
            Class.forName("java.lang.Module");
            isJava9 = true;
        } catch (Exception e) {
            isJava9 = false;
        }
        IS_JAVA9 = isJava9;
    }

    public static boolean isJava9() {
        return IS_JAVA9;
    }
}

Fix this to run on all Java 9+ JVMs
Fix this to run on all Java 9+ JVMs

Also cache the result so it does not keep checking.
