Error when building Orekit using Maven

Hello,
I am trying to use Maven to build Orekit as described here: Orekit – Building Orekit

But I am getting this error:
java.lang.IllegalAccessError: class org.orekit.compiler.plugin.DefaultDataContextPlugin$AnnotationTreeScanner (in unnamed module @0x2e582139) cannot access class com.sun.tools.javac.tree.JCTree (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.tree to unnamed module @0x2e582139

Besides Hipparchus, is this another artifact that I need to download and install?
Thank you,
Erin

Possibly you are using JDK 17 or something after JDK 11. Can you say what JDK you have, and can you try with JDK 11?

Hello @bradh -
Thank you for the advice. I believe I have successfully updated my JDK to version 11. When I run “java -version” from my Terminal, I see the following:
java version “11.0.17” 2022-10-18 LTS
Java™ SE Runtime Environment 18.9 (build 11.0.17+10-LTS-269)
Java HotSpot™ 64-Bit Server VM 18.9 (build 11.0.17+10-LTS-269, mixed mode)

But when I try running “mvn package” from the top level of the orekit directory that I have downloaded to my Mac, I am now receiving this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project orekit: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.22.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-surefire-plugin:jar:2.22.2 → org.apache.maven.surefire:maven-surefire-common:jar:2.22.2: Failed to read artifact descriptor for org.apache.maven.surefire:maven-surefire-common:jar:2.22.2: Could not transfer artifact org.apache.maven.surefire:maven-surefire-common:pom:2.22.2 from/to central (Central Repository:): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/surefire/maven-surefire-common/2.22.2/maven-surefire-common-2.22.2.pom: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

When I run “mvn -v”, I see: “Apache Maven 3.8.2”, so I think I have the right version of Maven based on the fact that the directions for building Orekit refer to Maven 3.

Do you have any advice about this error?
Thank you,
Erin

I’m not sure - its hard to tell without knowing exactly what you’ve configured. I can say I don’t see this problem, but my configuration is on Linux.

I’m guessing you are missing certificates. That could be because you just don’t have the right root certs on your machine, or because java isn’t looking in the right place. Does the link work in the browser?

Can you try add -Djavax.net.debug=ssl to the maven command to see if that gives you more information?

(At this point, I’m pretty much googling the error message, so sorry I can’t help more).

Hi,

As @bradh suggests it looks like a certificate problem. Are you behind a company proxy or anything similar ?
I suggest you to try this solution or that one maybe.

You were right! I worked with my organization to figure out the certificate problem, and I have now been able to build the jar :smile:
Thank you both for your help,
Erin