There are several points you should consider:
- The bytecode of string concatenation changed several times. It is no longer a pitfall for bad performance. Yet i'm not sure if this comes from the refactoring of the bytecode representation or from changing the VM.
- An old (system) JDK/JRE may open security risks on the development machine. If the developer is using an outdated JDK/JRE he may be vulnerable to malicious software he is executing.
- An outdated java version on client side exposes the user to security risks. If you allow your user to use an old Java version they will do it. This may be a security risk.
- Java 6 is no longer publicy supported. The security problem is that a user is neither informed that his java version should be updated nor is he forced to do it. Keep in mind that Java is in the top3 list of security vulnerabilities.
You can use Java 1.7 features while compiling for 1.6 target. Using-source 1.7
and-target 1.6
you can use language features likeint i = 0b011
- Tools shipped with your JDK get updated. There maybe new tools for developing java application, e.g. at some point java VisualVM was added to the JDK.
Looking at that list i think the pros of using a current JDK outweighs the pros of using an old one.
EDIT: I investigated a little bit and i suggest now that you install the JDK which suits your target version. You need the JDK anyway when you are cross compiling because of the bootstrap/ext classpath. See How to cross-compile for older platform versions for further information. This site also states that there are differences in compilation between different JDKs (second to last paragraph) and suggests to use the JDK relevant to your target version (last paragraph). Also relevant may be the javac documentation.