is there any way to use java 7 syntax and produce bytecode that works on 1.5? as far as i know, options -target and -source can't be different. checking if no new API was used also would be nice but is not crucial
No, it is not. As far as I know, different -source and -target work, but only if the source is lower or equal the target (in order to provide backwards compatibility). There may be source converters that convert your java 7 code into older versions.
There's a project called Retroweaver which allows you to write Java 5 syntax (including generics, etc.) and convert it to code that runs on Java 1.4 and older.
As far as I know there isn't anything like that to make code with Java 7 syntax work on older versions.
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