0

When building apache-camel with openJDK-11. There are a lot of missing dependencies like * jaxb * annotation * ...

How to build apache-camel source code with openJDK? Officially there is no documentation on how to build using openJDK; Is there is any way to force build it?

I have tried adding jaxb implementation for server like "org.eclipse.persistence.moxy" but the same wasn't picked up properly :(

I have restricted the build env to be only open source; hence using openJDK as the base for development.

  • All things considered, a lot has changed with the newer versions of Java, so I'm not *that* surprised that it wouldn't build today with OpenJDK 11...Camel's a **big** project and there's a lot of possibility for breakage with the fact that several previously bundled dependencies aren't there when you're compiling today. – Makoto Mar 29 '19 at 04:27

1 Answers1

1

According to this article https://blog.codefx.org/java/java-11-migration-guide/ several packages have been removed from JDK 11.

In particular the section called Migrating From Java 8 To Java 11 shed some light on how to deal with this.

In short the following packages were removed:

  • The JavaBeans Activation Framework (JAF) in javax.activation CORBA in the packages javax.activity, javax.rmi, javax.rmi.CORBA, and org.omg.*
  • The Java Transaction API (JTA) in the package javax.transaction
  • JAXB in the packages javax.xml.bind.*
  • JAX-WS in the packages javax.jws, javax.jws.soap, javax.xml.soap, and javax.xml.ws.*
  • Commons Annotation in the package javax.annotation

To fix this:

Add third-party dependencies that contain the classes you need. The easiest way to do that is to stick to the reference implementations (given as Maven coordinates without version – use the most current ones):

  • JAF: with com.sun.activation:javax.activation
  • CORBA: there is currently no artifact for this
  • JTA: javax.transaction:javax.transaction-api
  • JAXB: com.sun.xml.bind:jaxb-impl
  • JAX-WS: com.sun.xml.ws:jaxws-ri
  • Commons Annotation: javax.annotation:javax.annotation-api

You can also view some more information using this Stackoverflow answer

Namphibian
  • 12,046
  • 7
  • 46
  • 76