Does Hello World! program compiled by JDK 7u3 runs with an older JREs (eg. JRE 6)?
If the answer is YES, When a java program doesn’t run with an older JRE?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default the class files produced by javac will have a version number appropriate for the JDK they were produced on. To produce class files for earlier versions you will need to specify
-targetand to do that you will also need-source.-source 1.6 -target 1.6say.However, you will still be picking up the current Java library, which contain classes, methods (possibly overloads), etc., that were not in the previous version. To sort that out, use
-bootclasspathto point to thert.jarof the target JRE.