private int version(String java9Name, int java8Index) {
        try {
            // Try Java 9 first
            final Method method = Runtime.class.getDeclaredMethod("version");
            if (method != null) {
                final Object version = method.invoke(Runtime.getRuntime());
                final Class<?> clazz = Class.forName("java.lang.Runtime$Version");
                return (Integer) clazz.getDeclaredMethod(java9Name).invoke(version);
            }
        } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | ClassNotFoundException unused) {
            // we are pre Java 9
        }
        try {
            return Integer.parseInt(System.getProperty("java.runtime.version").split("([\\._-])")[java8Index]);
        } catch (Exception t) {
            return 0;
        }
    }
Returns the <a href="#security">security</a> version number or zero if it
was not set.

@return The security version number or zero if it was not set
common-parent/jvm-version/src/main/java/com/speedment/common/jvm_version/internal/InternalJvmVersion.java