Issue with OrekitException in Orekit Attitude Tutorial

Apologies, I’m very new to Java so this question may be quite basic. I’m currently running Orekit 12.2 with Jave openjdk 17.0.14, Maven 3.9.9. When trying out the tutorials (attitude->EarthObservation) I get an error that the class org/orekit/errors/OrekitException cannot be found. I’ve verified that it’s in the Maven repository for Orekit 12.2. I don’t get the error during mvn package or mvn install but it pops up when I run the tutorial (java -cp .\target\orekit-tutorials-12.2.jar org.orekit.tutorials.attitude.EarthObservation). Does anyone have an idea of what could be causing this?

Found the issue. If anyone runs into a similar problem, I needed to “shade” the library code into my output JAR file using the built-in maven shade plugin. I included this into the default pom.xml file:

<build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.5.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
2 Likes