Please pay attention to the -target when compile This is because you are using a higher JDK version to compile than the JRE version to run. If you are using a higher JDK version and want to run with lower JRE version, please use "-source" and "-target" parameter to specify a minimum version to run. Please refer to http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html and search 'target' on that page. reply
This is because you are using a higher JDK version to compile than the JRE version to run.
If you are using a higher JDK version and want to run with lower JRE version, please use "-source" and "-target" parameter to specify a minimum version to run. Please refer to http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html and search 'target' on that page.