Build Issue 11.3 Ubuntu - Eclipse

Hello all,
I’m attempting to use Orekit on an Ubuntu machine, and I am having issues building and using the software. I originally was using Maven, but I could not get java to find any Hipparchus package. Therefore, I switched to Eclipse. After installing Eclipse, I followed the build instructions and promptly got the error:

Description Resource Path Location Type
DefaultDataContextPlugin cannot be resolved to a variable /orekit-11.3/src/test/java/org/orekit/compiler/plugin line 72 Java Problem

Does this ring any bells for any users?

Any help is appreciated,

Yes, this is a known issue with Eclipse. It is due to an internal dependency Eclipse cannot understand (but Maven does). This dependency is the compiler plugin that allows to detect use of default context. The plugin must be compiled first and then the rest of the library, including the tests, can be built.

We don’t know how to make Eclipse understand this, so for now we just use a workaround, which shuts down some tests. Here is how to do that:

  • in the package explorer context menu for the Orekit project, select “Build Path →Configure Build Path”
  • in the Java Build Path wizard, select the “Source” tab
  • in the source tab, scroll down to orekit/src/test/java, select “Excluded” and press the “Edit” button
  • in the “Inclusion and Exclusion Patterns” window, go to the “Exclusion pattern” area and press “Add”
  • in the “Add exclusion pattern” window, press the “Browse” button
  • in the “Exclusion pattern selection” window, unfold the tree until you can select “org→orekit→compiler” and press “OK”
  • close all the windows

The goal of this procedure is to have eclipse ignore the org.orekit.compiler package in the test sources, which is the part it cannot handle.

Hope this helps

1 Like

Hi, @luc and @MarcoBCT,

Yet I have not really understand what does the DefaultDataContextPlugin do.

However, to remove the error, here is an alternative method.
Two steps in Eclipse:
(1) Remove the excluded of org/orekit/compiler/** from source (Properties->Java Build Path->Source);
(2) Add the library tools.jar, the configuration in file pom.xml is ${java.home}/../lib/tools.jar, which may be not valid.

Furthermore I feel we can just ignore the error.

Hi @lirw1984,

It’s a plugin wrote by @evan.ward allowing the usage of the annotation @DefaultDataContext.
This annotation is used to warn the user that he’s using the “default” data context and should be aware of it.
Suppose you carefully design your own data context with a specific set of Earth Orientation Parameters to model your ITRF frame.
But then you call by inattention FramesFactory.getITRF(...) which uses the default data context and the default EOPs. Then you will get a warning at compile time telling you that you used the default data context but didn’t document it with the annotation.
It’s a protection to avoid mistakes when dealing with data contexts.

Hi @MaximeJ,

Thanks. Now I know it.
It’s really a warm design.