Mohamed
Mohamed

Reputation: 2352

Migration Jave 11 _ How to resolve : java.lang.ClassNotFoundException: javax.activation.MimeTypeParseException

I'm migrating my java project from 8 to 11 version.

As javax.activation has been removed from JDK 11, so I added it to Maven pom.xml file :

<dependency>
  <groupId>javax.activation</groupId>
  <artifactId>activation</artifactId>
  <version>1.1.1</version>
</dependency>

The dependency is listed in "Externat librairies" but every time I run "mvn clean install" to build my project, I get this error :

...
Caused by: java.lang.ClassNotFoundException: javax.activation.MimeTypeParseException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 51 more

Have you any idea please ? Thanks

Upvotes: 6

Views: 3640

Answers (1)

Laurent Schoelens
Laurent Schoelens

Reputation: 2848

Sadly @lexicore is no more here to answer but the maven-jaxb2-plugin (which was renamed jaxb-tools since get merged with other related jaxb-projects) is still (and back) under active development and is now supporting jdk11 as well as jdk17 and even jdk21.

Support of jaxb-jakarta is also OK (jaxb3 and jaxb4)

You can check the migration guide to get the latest versions available based on targeted jaxb version.

Upvotes: 0

Related Questions