Created
March 23, 2017 15:06
-
-
Save johnpoth/b06d33418b97ed310452ff82c5cfb7b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static int getJavaVersion(){ | |
String javaSpecVersion = System.getProperty( "java.specification.version" ); | |
if (javaSpecVersion.contains(".")) {//before jdk 9 | |
return Integer.parseInt(javaSpecVersion.split("\\.")[1]); | |
}else { | |
return Integer.parseInt(javaSpecVersion); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment