java compiler's target version “jsr14” with JDK7/8

前端 未结 3 650
無奈伤痛
無奈伤痛 2021-02-08 10:09

Can anybody tell me the jsr14 target option of javac will be still available with JDK7/8?

Say,

$ javac -source 1.5 -target jsr1         


        
3条回答
  •  情深已故
    2021-02-08 10:21

    We are heavily using -jsr14 in OSGi because it allows us to use generics in our API but still deploy on 1.4 environments, which are still popular in embedded. Unfortunately, they made JDK 7 not backward compatible with Java 6 and 5. Javac 1.7 ignores the generic information that is actually present in the JAR files. There is fortunately no problem at run-time as this info is ignored anyway. And it is not as if this was some undocumented feature ...

    Unfortunately, people at the front often have very little regard for the people that cannot just update to the latest and the greatest. Guess Oracle really does not care about the embedded markets anymore.

    We will likely now have to ship two JARs, one for the embedded and one for JDK 7. Sucks.

    This is the bug report we filed: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7078419

提交回复
热议问题