Skip to content

Getting started with NetBeans and Maven

Joshua Slack edited this page Sep 19, 2017 · 1 revision

Maven's primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that

Maven attempts to deal with:

  • Making the build process easy.
  • Providing a uniform build system.
  • Providing quality project information.
  • Providing guidelines for best practices development.
  • Allowing transparent migration to new features.

The below instructions are for the NetBeans IDE, however it is possible to use other IDEs such as IntelliJ or Eclipse if they suit you better.

The Steps

You will need to have JDK version 6.0 or better installed. You can get this here.

You will need Subversion installed. You can get this here.

If you do not have NetBeans yet, head over to http://www.netbeans.org and get the latest stable version of the “IDE. It's a very simple install, just download the installer for your operating system or the portable zip version. If you choose the zip version : unzip it and move the resulting “netbeans” folder to your applications directory or similar. You're done.

  • If you already have the ardor3d source code just skip to 'COMPILING'

To download the source code, goto Netbean menu: Team > Checkout and fill in the different needed parameters:

url : http://ardorlabs.svn.cvsdude.com/Ardor3Dv1 , login, password and folder

Once done you will see in the output window that netbeans is downloading the source and will open the projets once done.

COMPILING:

  1. You need to have Maven installed which you can get Here.
  2. In NetBeans, go into Tools→Options→Miscellaneous→Maven and make sure the “External Maven Home” points to your Maven install.
  3. Right click on the Ardor 3D project, choose Properties. Click on Actions and make sure “Use external Maven for build execution” IS checked. Then click OK.
  4. Now right click again on the Ardor 3D project and choose “Build”.

On my ( Renanse) box, (Vista 64bit) this fails because the SWT tests have issues with 34bit libs on a 32bit jvm:

java.lang.UnsatisfiedLinkError: Cannot load 64-bit SWT libraries on 32-bit JVM
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
at org.eclipse.swt.widgets.Widget.<clinit>(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

To fix this, I expanded the project→Modules→ and double clicked on Ardor 3D SWT to open that project. Then I right clicked on the Ardor 3D SWT project that appeared →Set Configuration→win32. Then I right clicked on that project again and chose Clean and Build and all was well.

Unfortunately, this means I had to build each of the modules individually because “Building” the Ardor 3D project seemed to not obey the configuration I set on the Ardor 3D SWT project I set. So I right clicked on Ardor 3D and chose Open Required Projects.

I right clicked each and chose Build. They need to be built in the right order to get all the dependencies right, but you can just go through them a few times until all the ! marks are gone.

TO RUN:

  1. Right click on Ardor3D Examples and go to Run. In VM Options I had to put: ** -Djava.library.path=”../ardor3d-lwjgl/lib/lwjgl/native/windows/” ** and hit OK. (You can include Jogl in there too/instead if you'd like.)
  2. Now right click on Ardor3D Examples again and chose Run. It asked me to pick a main class, so I chose “com.ardor3d.example.RunExamples” and hit OK. Yay… Wheew.

###NOTE:

Tip: Netbeans handle maven project without any extra configuration (relying on an embedded Maven3). If you want to switch to your local maven installation (if it's not in the system path) go in tools → options → miscellaneous → maven