Setting up Eclipse IDE with Orekit

Hi all, I did some search but I’m not able to find what I’m looking for on the forum. So I’ll be the one to raise my hand and maybe ask the stupid question. I hope this will be beneficial to other users as well, I know a couple of my friend who stayed away from orekit because it is much harder to get start as compared to some other astrodynamics package.

So the simply question, what is the recommended way to install, configure, and start using orekit to build my own project/learn? I got as far as importing the pom.xml file and Eclipse seems to be happy after that. I try to run a few code and it all seems okay. But then the following line from the orekit install page “Now you have an orekit-x.y project in you workspace, and you can create your own application projects that will depend on the Orekit project.” I not exactly sure what to make of it, on top of the fact that I’m already feeling very lost at this point.

I have taken a full java course just so I can use the package, but it doesn’t really cover how to properly setup orekit in Eclipse IDE. Could one of you pros maybe given a few pointers? If there is a page with this exact information already then I apologize, but I have did quite a few rounds of search on Google as well. Would really appreciate the help!

If IntelliSense is working and you are seeing the various packages when you type you are mostly there. The big thing to remember is to initialize the Orekit data. The various tutorial code samples show how to do this. There is a repository for all of these as well. You shouldn’t need to import a pom.xml to just write code. It’s as simple as adding the Orekit dependency to the pom.xml (or Gradle file). A link to the MVN repository with the config string to add to the respective build system configuration is here:

https://mvnrepository.com/artifact/org.orekit/orekit/10.1

A direct link to the tutorial repository is here.:

1 Like

Thanks for getting back, I’m importing the pom.xml because that was in the install instruction from the Orekit installation page. I don’t completely understand what you mean by adding the Orekit dependency to the pom.xml.

I have not used IntelliSense, but I got Eclipse to work. I’m also just mostly confused about this statement “Now you have an orekit-x.y project in you workspace, and you can create your own application projects that will depend on the Orekit project.” I’m not sure what to do with it, I want to learn and eventually develop with Orekit so I want to try to have my setup and where to write my code in the correct place (best practice so to break).

Hi,

In other words, this sentence can be “Congratulations you have installed Orekit in your IDE.” It is just here to say that you have properly installed Orekit and now you can use Orekit to build your own application.

For the first point, if you want to learn with Orekit, you can use the different Orekit tutorials as pointed by Hank. Orekit tutorials project can be installed using the same instructions as Orekit.

For the second point, if you want to use Orekit to build your own application, you have to create another project inside Eclipse IDE. After that, you have two possibilities:

1.Create a pom.xml file in your new project and add an Orekit dependency.

<properties>
<myproject.orekit.version>10.1</myproject.orekit.version>
</properties>

And

<dependencies>
<dependency>
  <groupId>org.orekit</groupId>
  <artifactId>orekit</artifactId>
  <version>${myproject.orekit.version}</version>
  <type>jar</type>
  <optional>false</optional>
</dependency>
<dependencies>

Now you right click on your new project and you select Maven -> Update Project .… -> OK
This will build your application and allows it to use Orekit functionalities.

2.After creating your own application, you can right click on it and select Build Path -> Configure Build Path. In the Projects window, select Add …, click on Orekit project and click on ok. Finish the configuration by clicking on Apply and Close.

The main difference between the two possibilities is that using the first one, you can build an application that can be use and build properly inside and outside Eclise IDE. For instance if you want to build a mobile application. Using the second point, the dependency of your application to Orekit project is just locally. In other words, outside Eclipse IDE the dependency is not configured.

Regards,
Bryan

1 Like

@bcazabonne I really appreciate your detailed reply, I supposed when I read the sentence from the installation page I took it very literally as I have no other reference/experience in dealing with java project such as Orekit.

And yes, I noticed the Orekit tutorials. I will use it as my starting point and at the same time try what you have suggested. Once again, really appreciate the feedback!

Do not hesitate to ask questions if you have :slightly_smiling_face:

2 Likes