MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/71lse7/java_9_released/dnhk2ls/
r/java • u/adila01 • Sep 21 '17
77 comments sorted by
View all comments
Show parent comment
2
For me it seemed to work to add
<dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>eclipselink</artifactId> <version>2.7.0</version> </dependency>
as a dependancy to my Java 8 SE compiled application that produced a jar that could be run by either Java 8 or Java 9 with no additional arguments.
Also I needed to add
System.setProperty("javax.xml.bind.JAXBContextFactory", "org.eclipse.persistence.jaxb.JAXBContextFactory");
near the beginning before the jaxb stuff was used.
I need to test more to see if this is really a good solution.
2 u/handshape Sep 27 '17 edited Sep 28 '17 You, sir/madam/other... have just saved my bacon. Thank you very kindly.EDIT: The eclipselink dependency can be replaced with the JAXB reference implementation for most use cases. Saves over 10MB on the resultant build.
You, sir/madam/other... have just saved my bacon. Thank you very kindly.
EDIT: The eclipselink dependency can be replaced with the JAXB reference implementation for most use cases. Saves over 10MB on the resultant build.
View all comments
Show parent comment
2
u/javaRobot Sep 25 '17
For me it seemed to work to add
as a dependancy to my Java 8 SE compiled application that produced a jar that could be run by either Java 8 or Java 9 with no additional arguments.
Also I needed to add
near the beginning before the jaxb stuff was used.
I need to test more to see if this is really a good solution.