I'm currently thinking about adding a small part of JSR-310, javax.time.Duration
to our library.
This works perfectly fine currently.
But JSR-310 is planned to be integrated in Java 8! When executing our application on Java 8, what will happen if there is both a javax.time.Duration
class in the standard library and the same class shipping with our jar file?
Will one of the classes be silently ignored? (Which one?) Will there be an error when a Java 8 VM tries to load the class from our library?
Are there any compatibility issues I need to be aware of?
The JVM follows the classpath to determine which class to load. If there is more than one, the later classes are silently ignored.
For class included in the JVM itself, these are part of the bootclasspath which is searched before the class path.
Unless there is a breaking change in the API, you shouldn't notice the difference and your extra JAR will effectively be ignored with Java 8.