java-11

Unable to compile simple Java 10 / Java 11 project with Maven

会有一股神秘感。 提交于 2019-11-25 21:39:06
I have a trivial Maven project: src └── main └── java └── module-info.java pom.xml pom.xml: <groupId>org.example</groupId> <artifactId>example</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>example</name> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <release>10</release> </configuration> </plugin> </plugins> </build> When I build the project via mvn -X install -DskipTests=true , it fails: org.apache.maven.lifecycle.LifecycleExecutionException: Failed

How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

一曲冷凌霜 提交于 2019-11-25 21:38:01
问题 I have some code that uses JAXB API classes which have been provided as a part of the JDK in Java 6/7/8. When I run the same code with Java 9, at runtime I get errors indicating that JAXB classes can not be found. The JAXB classes have been provided as a part of the JDK since Java 6, so why can Java 9 no longer find these classes? 回答1: The JAXB APIs are considered to be Java EE APIs, and therefore are no longer contained on the default class path in Java SE 9. In Java 11 they are completely