Build Failure: FastMathTest.checkMissingFastMathClasses:1542 FastMath should implement all StrictMath methods ==> expected: <true> but was: <false>

Hi the Develop Team,

I am not sure which place I should post my question exactly. I have posted the following question in the github discussion. Just in case that is the wrong place, I copy it here.

Per the requirement of an open source project, the Orekit, which depends on Hipparchus, I need to install the Hipparchus into my local maven repository, by following commands:

git clone https://github.com/Hipparchus-Math/hipparchus.git
cd hipparchus
mvn install

But I got the following failure message:

[INFO] Results:

[ERROR] Failures:
[ERROR] FastMathTest.checkMissingFastMathClasses:1542 FastMath should implement all StrictMath methods ==> expected: but was:

[ERROR] Tests run: 6829, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Hipparchus 4.1-SNAPSHOT:

[INFO] Hipparchus ......................................... SUCCESS [ 6.933 s] $$
> $$ > [INFO] Hipparchus::Core … FAILURE [01:48 min]

[INFO] Hipparchus::Statistics … SKIPPED
[INFO] Hipparchus::Computational Geometry … SKIPPED
[INFO] Hipparchus::Ordinary Differential Equations … SKIPPED
[INFO] Hipparchus::Optimization … SKIPPED
[INFO] Hipparchus::Fitting … SKIPPED
[INFO] Hipparchus::Cluster Algorithms … SKIPPED
[INFO] Hipparchus::Samples … SKIPPED
[INFO] Hipparchus::Fast Fourier Transforms … SKIPPED
[INFO] Hipparchus::Filtering Algorithms … SKIPPED
[INFO] Hipparchus::Coverage … SKIPPED
[INFO] Hipparchus … SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:55 min
[INFO] Finished at: 2026-04-03T17:09:55+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.2:test (default-test) on project hipparchus-core: There are test failures.

[ERROR] See /home/hanbing/Code/hipparchus/hipparchus-core/target/surefire-reports for the individual test results.
[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :hipparchus-core

As I am really new to this lib, could someone give me a clue where I might get it wrong?
For your information, I am working this on a Ubuntu OS with Maven, the output of mvn -v are

Apache Maven 3.8.7
Maven home: /usr/share/maven
Java version: 25.0.2, vendor: Ubuntu, runtime: /usr/lib/jvm/java-25-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: “linux”, version: “6.17.0-1012-oem”, arch: “amd64”, family: “unix”

Thanks a lot in advance for any comments.

Regards,
Hanbing

Hi @Hanbing,

Welcome to the forum!

I’ve just run the same command as yours right now to see if I experienced the same issue as yours. And I don’t, it’s running fine.
So I don’t really now what happens.

Several ideas to fix this:

  • You’re trying to build version 4.1-SNAPSHOT, meaning that you are on the develop branch of the repository. This is not the official release version of Hipparchus.
    If this is not intended, you have to checkout the main branch which contains the official release.
    Once you have done this, run mvn clean install again

  • If you really need version 4.1-SNAPSHOT (to use the develop branch of Orekit for example), you can install Hipparchus without the tests. Run:
    mvn clean install -DskipTests
    This will build without testing, and the error you have won’t block you anymore.

Hope this helps,
Maxime

Hi Maxime,

Thanks a lot for your reply.

Yes, exactly, I am trying to build the develop version of the Orekit, which requires the user to build Hipparchus from source code.

As you mentioned that, you tried the same commands as mine and did not find anything wrong. May I ask if you also did that on the develop branch instead of the main branch of Hipparchus?

Thanks for your suggestion about the workaround. I will try it.

Just out of wondering, from your point of view, does this failed test probably come from the developing code or my local OS environment? Normally, we don’t just ignore failed tests when we develop something reliable, right?

Best regards,
Hanbing

Hi,

Have you tried the same command in Java 8 or 11? The former is Hipparchus official language version and the latter is the one used by CI/CD.
It is possible that new functions in StrictMath with java 25 make this test fail.

Cheers,
Romain

1 Like

Hi Romain,

thanks for your reply.

No, I didn’t try the building with Java 8 or 11. As I am pretty new to the Java world, I thought just getting the latest available Java version on my OS should work.

So, do you mean there are specific Java versions that Orekit or Hipparchus depends on?

Best regards,
Hanbing

This is slightly more complicated.

For now, Hipparchus and Orekit need Java 8 at least, it will be updated to Java 21 (or more) in the near future.

However, one of the FastMath class perks is that is brings back to Java 8 (currently) some of the methods that were really introduced in later versions of the language. Some very important methods for Orekit are cbrt and the inverse hyperbolic functions. The class also intends to be a drop-in replacement of the standard Math class. So if people use more recent Java version (25 in your case), then all the new methods available in Math should be made available in FastMath despite it only depends on Java 8. This is what this test checks. When the test fails, it means new methods have been introduced and we need to add them to FastMath. We have done this up to Java 21, but not yet Java 25.

This is not really important, though, so you could just comment out the test if you want to compile and install Hipparchus with Java 25.

Could you nevertheless open a ticket on our GitHub project so we don’t forget to add these new methods? I didn’t check which methods have really been added.

1 Like

Hi @luc ,

thank you very much for your detailed explanation. It makes me feel more secure to just ignore the failed test now.

Instead of install another Java version and learn how to manage different versions of Java on my OS, I prefer to just apply the work-around suggested by @MaximeJ.

Sure, I’ll launch an issue on the Github repo of Hipparchus.

Thanks again for you guys’ help.

Best regards,
Hanbing