Package javax.xml.bind.annotations is declared in module java.xml.bind, which is not in the module graph
已回答
Hello, since I upgraded to 2018.1 all my JAXB annotations are breaking with error "Package javax.xml.bind.annotations is declared in module java.xml.bind, which is not in the module graph"
I was using JDK9.0.1 from Oracle before the upgrade and I'm still using the same JDK after the IntelliJ upgrade, so I'm not sure if this is a new restriction or what.
Has anyone faced a similar issue or any idea what the problem might be?
Thanks!
Cyril
请先登录再写评论。
Hello Cyril,
Do you have "--add-modules" option enabled: https://www.logicbig.com/tutorials/core-java-tutorial/modules/root-modules.html ?
Hi, having the same issue since 2018.1.
My code compiles perfectly fine because of this maven dependency: https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api
But IntelliJ isn't detecting it anymore
Does adding
--add-modules "java.xml.bind"JVM flag help?Doesn't seem to do anything for me.
Please follow the issue on YouTrack for updates: https://youtrack.jetbrains.com/issue/IDEA-189060
Thank you Yaroslav. Is there a way to subscribe for updates on YouTrack tickets?
Just like Mikuschger, my mvn build works fine w/o any --add-modules. Please specify how to add this flag to IntelliJ 2018 if it that's what you meant.
I'm on Ubuntu 16.04 FYI if that makes a difference. My colleagues on OSX don't seem to have this issue with the same project files.
See https://intellij-support.jetbrains.com/hc/articles/207241135.
I have a similar issues, but with maven. If I run mvn clean install for a project from within a terminal, all forks fine. Using the maven support in IDEA gives me the error from the title.
This is what I use regarding the compilation:
Hello Marcel,
Could you please share project example? It works fine on my machine with test project.
Hi Yaroslav, thank you for the extremly quick answer. I worked my way through our maven hierarchy of parent and root poms and finally came up with a simple pom and test class.
So, here is the pom:
And here is a simple class:
Additonal Infos:
Apache Maven 3.5.3
Maven home: /usr/share/maven
Java version: 10.0.2, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-10-oracle
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.17.0-1-amd64", arch: "amd64", family: "unix"
I have set up IntelliJ to use the same maven, but also tried with the bundled version.
If you remove the <executions> tag including its children, It will compile in IntelliJ.
Marcel,
Test project based on provided pom.xml builds fine on my machine. Is it possible to provide whole project dir with IDE files/folders (.idea and .iml)?
Of course. Could you please provide an e-mail address or a space where I can upload the project?
Please use https://uploads.services.jetbrains.com/ or FTP: ftp://ftp.intellij.net
OK, done :-)
Thanks for example! I reported an issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-197956. Please follow it for updates.
IntelliJ IDEA and command line Maven work the same for me, see https://youtrack.jetbrains.com/issue/IDEA-197956#focus=streamItem-27-3043338-0-0.
Marcel,
Don't you run "install" action from maven-install-plugin in command line? Message is generated by apt-plugin and is shown when running from command line.
I guess you are using java 9. If that's the case then you need to download and add the javax jar into your project
Hi
I have got 2019.1 version of Pyharm and trying to use Custom JDBC driver provided by Vendor.I believe connections goes through half way and fails with following error
java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
I tried adding the additonal jar files for Jaxb-Api, but it is still displaying same error. I am new to Pycharm and less java knowledge. Any advice on how I can resolve this please ?
Regards
Venky
@... see https://youtrack.jetbrains.com/issue/DBE-8917 about similar error. PyCharm uses JDK 11 to run under. The jdbc driver you are using must be compatible with 11 JDK version. If you are using driver provided by the IDE, - latest PyCharm version provides the compatible jdbc drivers. Or else you can download driver and set it up manually in driver settings for the Data Source.