How to know JDK version from within Java code
I presume you mean just the Java version, in which case try this:
String version = System.getProperty("java.version");