I have a code.jar running well in 1.7 version java, but when using another computer with linux with version 1.6 it is giving me an error, how can I run it in 1.6 version?
Use the cross-compilation options when invoking javac.
If only the -target option is specified as recommended in most other replies, the 1.7 SDK will issue a warning about -bootclasspath. That option requires an rt.jar of the target JRE version (note not JDK). It allows the compiler to check that the classes, methods and attributes of the code that reference core Java SE are actually present in the rt.jar. This is very important to ensure compatibility.
If the code is not compiled with an older Java compatibility flag, you won't be able to run it on 1.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With