JkJavaCompiler { static String currentJdkSourceVersion() { final String fullVersion = System.getProperty("java.version"); return currentJdkSourceVersion(fullVersion); } private  JkJavaCompiler(T __); static JkJavaCompiler<Void> of(); static JkJavaCompiler<T> ofParent(T parent); JkJavaCompiler<T> setCompilerTool(JavaCompiler compiler); JkJavaCompiler<T> setForkingProcess(JkProcess compileProcess); JkJavaCompiler<T> setDefault(); JkJavaCompiler<T> setForkingWithJavac(String... parameters); JkJavaCompiler<T> setForkingWithJavacIf(boolean condition, String... parameters); boolean isDefault(); @SuppressWarnings("unchecked") boolean compile(JkJavaCompileSpec compileSpec); static JkProcess getForkedProcessOnJavaSourceVersion(Map<String, String> jdkLocations, String version); final T __; }
@Test public void currentJdkSourceVersion() { assertEquals("12", JkJavaCompiler.currentJdkSourceVersion("12.0.1")); assertEquals("8", JkJavaCompiler.currentJdkSourceVersion("1.8.0_211")); assertEquals("9", JkJavaCompiler.currentJdkSourceVersion("9.0.1")); }