Retrolambda allows conversion of Java 8 class files to Java 7 format (and before). It explicitly doesn't backport Java 8 APIs. If I want to also replace all references to java.time.*
with corresponding org.threeten.bp.*
API, is there a way to do so? The idea is to produce separate JARs for Java 8 (using java.time
) and for Java 7.
Asked
Active
Viewed 163 times
1

Alexey Romanov
- 167,066
- 35
- 309
- 487
-
3I would create a build of threetenbp which uses the `java.time` package. This way you don't need to change your code to migrate to Java 8. – Peter Lawrey Nov 06 '15 at 14:36
-
This is a good idea, but a bytecode-rewriting solution could also handle methods like `Date.toInstant` (or be extended to do so). Still, it gets most of the way there, thanks! – Alexey Romanov Nov 06 '15 at 16:33
-
1defining classes in java.* outside of the JVM installation is a no-no – araqnid Nov 08 '15 at 22:33