-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support java 9 projects #282
Comments
This adds an explicit jaxb dependency to fix consuming projects that build with and target java 9.
I can't build my project because of this issue. |
You can add an explicit dependency on jaxb-api to your project until jjwt adds the dependency or removes the usage of jaxb classes: |
Any advice on how to configure this same workaround for a Java 9 proejct built with ant?
|
When will the commit from @RyanBard be merged and when will there be a Java 9 compatible release? |
@househacker, I haven't used ant in a long time, but I assume you can just specify the dependency information from maven (groupId=javax.xml.bind, artifactId=jaxb-api, version=2.3.0) if you use something like ivy. Otherwise, you can download the jar out of the maven repo and include it in your projects' lib dir or something: |
Thanks, I had success with the brute force setting: --add-modules java.se.ee
|
@RyanBard thanks for your help/input in this. The JAXB import was provided only because that was guaranteed to work in JDK 7 and 8 environments using the same code. The real solution to this problem is basically to detect if using JDK 8 and above, and if so, use the JDK's native Base64 encoder/decoder, and if on JDK 7, use the JAXB APIs. That said, we probably won't support JDK 7 for too much longer. |
@RyanBard I think we need to modify https://github.com/jwtk/jjwt/blob/master/src/main/java/io/jsonwebtoken/impl/DefaultTextCodecFactory.java to check for the presence of We'll still need to fall back to either the previous native Android codec or the JAXB api depending on if |
I'll try that out some time tonight. |
Closing as a duplicate of #333. Work will be tracked via that issue and we hope to have that released asap in the coming days. |
When #259 was fixed, it only verified that jjwt itself can be built with Java 9 (but targeting an older version of java). It did not address the problem of using jjwt in a project that is targeting Java 9.
You can see the problem in jjwt by modifying the
<jdk.version>
to 1.9 and trying to build:I have also created a project that uses jjwt and shows the problem referenced in #259: https://github.com/RyanBard/jjwt-consumer-example
The problem is that Java 9 has deprecated jaxb and it requires extra flags to include that module. If I understand correctly, jaxb will probably be completely removed in Java 10, so it seems like the best solution is to explicitly depend on jaxb. This should make it easier for jjwt to target multiple versions of java without having to build multiple artifacts with different classifiers.
The text was updated successfully, but these errors were encountered: