I built a JAR in NetBeans, setting the Source/Binary Format to JDK6. So it's compiled to jre6. I can use the JAR (outside the IDE), but if I send it to a machine with jre7
, I have to alter the environment variable to get it to execute from the JAR.
- Isn't Java backwards compatible? Shouldn't this work without effort on jre7? I am not doing -anything- fancy in this program. It's a few kilobytes, couple hundred lines, import on some
Map
classes fromjava.util
. - Is there a command-line option for java to use an older runtime, or an annotation to write in, to identify the class files as version 6?
Embarrassed I can't find specs to answer these questions.