Usually this happens because by default in the OS if java -version is searched it might show some old JDK version, so either change global env variable's value if you have privileges to do so else e.g., in linux instead of typing only 'java' while executing, type the complete path e.g., /usr/jav/jdk1.8/bin/java <<.class||.jar>>. This will ...