-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Connection Management
-
None
ClientMetadataHelper assumes that the driver version is found by building an URL to the jar file using the "jar" scheme, e.g. "jar:file:/path/to/jar/mongo-java-driver-3.4.2.jar!/"
On Java 9 this may no longer work, depending on how an application deploys the Java driver. There are three possibilities:
- Deployed on the classpath
- the existing code will continue to work
- Deployed on the module path as a Java 8-style jar file (like we currently create):
- tests of java 9 early access builds show that un-named modules like this can not be added to a runtime image via jlink, so the existing code looks like it will still work: the code source of the un-named module will just be an URL with the "file" scheme, as above
- Deployed on the module path as a Java 9-style versioned modular jar file (of our creation)
- Replace with call to ClientMetadataHelper.class.getModule().getDescriptor().rawVersion(). This will work whether the jar file is available as a "file" scheme URL or as part of a runtime image.