It depends. If your program doesn't use the new Java 7 language extensions, then you can run the Java compiler with the -source 1.6
and -target 1.6
options. But if you use Java 7 language extensions then -source 1.6
will result in compilation errors.
Certainly I'm aware that I can't use the new Java 7 features when doing so.
That includes Java 7 language features ... and dependencies on Java 7 changes to the standard class library APIs. Also be aware that there are small number of behavioural differences (aka API bug fixes) that may cause code to run differently on Java 6 and Java 7. They should be described in the Java 6 to Java 7 transition document.
UPDATE - This probably no longer an issue for you anyway, because Oracle have released Java 7 for Mac OSX.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…