You can compile for both now, with this fix. 1.7 is detected and invokeDynamic is turned on. What you can't do is turn invokeDynamic off for JDK versions that support it.