We are looking at upgrading some legacy code to Java 10. As JAXB is not visible by default (EDIT: and the proper long term solution is not to circumvent the sympto
jaxb-ri runtime uses ClassLoader#defineClass / Unsafe#defineClass
to do some bytecode modification in runtime to optimize performance. ClassLoader#defineClass
is tried first which causes the warning.
This legacy optimization is removed completely in jaxb-ri master (after 2.3.0, not released yet).
To disable this optimization for 2.3.0, set system property
com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize
.
After next jaxb-ri release updating to newest version will remove the warning. jaxb-core artifact will be discontinued in favor for JPMS support. Correct pom will look like:
javax.xml.bind
jaxb-api
2.4.0
org.glassfish.jaxb
jaxb-runtime
2.4.0
If you wish to try early, you can pick latest promoted build from: https://maven.java.net/content/groups/promoted/org/glassfish/jaxb/jaxb-runtime/