how to check the version of jdk being used in java code example Example 1: check java version java --version Example 2: check jdk version java -version