[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] uncompilable source - error from NetBeans



Michael Turner <michael.eugene.turner@gmail.com> a écrit :

Any suggestions about where to install Apache Commons Math 3?

As it is, I'm a little mystified about how to add anything to my
classpath in NetBeans. I have very little Java programming experience
.... gmake and C++ were my preferred tools when I was working on this
kind of code. I'd prefer a sequence like ftp/gunzip/config/make
install, but I guess I'm from the caveman days of programming ;^(

I used to work in Fortran 77, SCCS and the like. There are other cavemen here ;-)

I don't use Netbean, but rather Eclipse, so the way it is configured may
be slightly different, however, I'll give you some hint related to Eclipse, you may be able to translate them into NetBeans or any other IDE workings.

In the Eclipse IDE, there are many different ways you can use external libraries in a project. You may put the jar in a subfolder within you project and link to them, you can expand completely the libraries as full blown projects and say your application project depends on the libraries projects, you can have a separate collection of support libraries outside of the IDE workspace (for example in the ~/.m2/repository maven already uses) and there are more solutions.

One simple way to first try is to configure the classpath is to add a "libs" folder under the project folder and to put the jars (here commons-math3-3.2.jar and orekit-6.0.jar) in this folder (I think there is special handling for NetBeans for this and that either the name "lib" or "libs" is reserved for that, so look around with a web search engine for more information). On the project configuration, try to find a way to add "dependencies" or "libraries" and select these jar files (it is often possible to also put a link to the online javadoc or to a source archive in addition to the compiled binaries, and it helps a lot working with a library since the IDE will show you all documentation for the library).

Another way (which is the one I prefer), is to set one specific project for each component in the workspace, i.e. one project for Apache Commons Math, one for Orekit and one for the application, and in the application project configuration to set up dependencies to the two other projects also managed by the IDE. In this case, it is sufficient to select the projects themselves, as the IDE knows were it will put all the binaries.

best regards,
Luc





Regards,
Michael Turner

Project Persephone
K-1 bldg 3F
7-2-6 Nishishinjuku
Shinjuku-ku Tokyo 160-0023
Tel: +81 (3) 6890-1140
Fax: +81 (3) 6890-1158
Mobile: +81 (90) 5203-8682
turner@projectpersephone.org
http://www.projectpersephone.org/

"Love does not consist in gazing at each other, but in looking outward
together in the same direction." -- Antoine de Saint-Exupéry


On Wed, Jul 24, 2013 at 11:22 PM, MAISONOBE Luc <luc.maisonobe@c-s.fr> wrote:
Hi Michael,

Michael Turner <michael.eugene.turner@gmail.com> a écrit :


I'm trying to ease into the example code provided. Adding this line

  import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;

to a simple HelloWorld app, then trying to run it, caused an error
message about the app being uncompilable. Any idea what would cause
this?


This may happen if you don't have Apache Commons Math 3 in your classpath.
Perhaps you have a wrong version of the library (prior to 3.X the top level
import package was not the same), or perhaps there is a missing dependency
(in order to use Orekit you must have both Orekit and Apache Commons Math
declared as dependencies of your project).

best regards,
Luc



Regards,
Michael Turner

Project Persephone
K-1 bldg 3F
7-2-6 Nishishinjuku
Shinjuku-ku Tokyo 160-0023
Tel: +81 (3) 6890-1140
Fax: +81 (3) 6890-1158
Mobile: +81 (90) 5203-8682
turner@projectpersephone.org
http://www.projectpersephone.org/

"Love does not consist in gazing at each other, but in looking outward
together in the same direction." -- Antoine de Saint-Exupéry





----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.







----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.