public static ClassFileVersion ofJavaVersion ( int javaVersion ) { switch ( javaVersion ) { case 1 : return JAVA_V1 ; case 2 : return JAVA_V2 ; case 3 : return JAVA_V3 ; case 4 : return JAVA_V4 ; case 5 : return JAVA_V5 ; case 6 : return JAVA_V6 ; case 7 : return JAVA_V7 ; case 8 : return JAVA_V8 ; case 9 : return JAVA_V9 ; case 10 : return JAVA_V10 ; case 11 : return JAVA_V11 ; case 12 : return JAVA_V12 ; case 13 : return JAVA_V13 ; default : if ( OpenedClassReader . EXPERIMENTAL && javaVersion > 0 ) { return new ClassFileVersion ( BASE_VERSION + javaVersion ) ; } else { throw new IllegalArgumentException ( "Unknown Java version: " + javaVersion ) ; } } }
Creates a class file version for a given major release of Java . Currently all versions reaching from Java 1 to Java 9 are supported .