I've got a mixed JDK project - some modules use 1.4, and some use 1.5. In my 1.5 code, I've started using generics.
(I'm using IDEA build 2013).
Basically, I've now got problems being able to compile both 1.4 and 1.5 source.
In order to compile with generics, I added "-source 1.5" to the compiler command line parameters.
This works fine when compiling 1.5 files.
However, if 1.4 files are to be compiled, I get an error "javac: invalid source release 1.5". This is understandable - the 1.4. compiler doesn't understand 1.5 source.
So it's a bit ackward to get my code to compile - I need the extra parameter for 1.5, but this causes 1.4 to not work.
Does anyone have any suggestions for the best way round this?
Currently, I'm mainly working on 1.5 files. So I temporarily removed the command line parameter, compiled my 1.4 files, added the parameter back in and compiled my 1.5 files. This isn't too bad, as my 1.4 files aren't changing too much.
I think the root of the problem is that there's only a single place where you can add compiler command line parameters - you've got to have the same parameters for all different JDKs. So maybe this should be divided up per JDK - or even per module.
Also, I tried the "Use generics-enabled compiler" in the Compiler settings. I'm not 100% sure what this is supposed to do, but it brought up an error dialog "Compiler Class Not Found", "<idea-installation-folder>\lib\generics\collect.jar not found".