Getting started with Eclipse and Maven - Renanse/Ardor3D GitHub Wiki

We strongly recommend using this method as main method to get the most recent source code. In this page we will provide all the instructions necessary to clone Ardor3d on eclipse.

The Steps

Prerequisites

  1. You will need to have JDK version 6.0 or higher installed. You can get this here. Both OpenJDK and Oracle JDK are supported.
    • After installing it, make sure that the JAVA_HOME environment variable is set to the JDK installation folder. Maven uses the JDK set in this variable.
  2. If you already have a running Eclipse, check that m2e and EGit are installed.
  3. If you do not have Eclipse yet, head over to http://www.eclipse.org and get the latest stable version of the “Eclipse IDE for Java Developers”. It already comes with m2e and EGit. It's a very simple install, just unzip it and move the resulting “eclipse” folder to your applications directory or similar. That's it.
  4. To make running examples easier without fiddling with VM launch arguments for the native opengl libraries, install the mavennatives eclipse plugin from its update site: http://mavennatives.googlecode.com/svn/eclipse-update/
  5. If you want to use git in the checked out Ardor3D projects, go to Window -> Preferences -> Team -> Git -> Projects and make a tick at "Auto share projects located in a git repository". This will simplify the process greatly and is recommended.

Checking out Ardor3D

  1. Go to File->import->Maven->Check out Maven Projects from SCM, press next.
  2. Select git from the dropdown
    • If you can't select anything from the dropdown, you have to install the Git-Maven connector first. Click on the link "m2e Marketplace" in the bottom right and install "m2e-egit" from the list.
  3. Copy https://github.com/Renanse/Ardor3D.git into the URI textfield, press finish, grab a coffee.
  4. Let Eclipse install supporting Maven plugins if it asks (in case it's a fresh Eclipse or they haven't been installed yet).

Note: If you want to contribute to Ardor3D and work on it in your own git fork in a special branch, then you can't use the simple "Check out Maven Projects from SCM" way described above. This is due to a bug that doesn't let you choose the initial branch (and switching branches is awkward in Eclipse for multi-module projects). An alternative (a bit more complicated) way is described below:

Alternative way

Part 1:

Either checkout your branch from command line like:

git clone https://github.com/username/Ardor3D.git -b mybranch /some/folder

or do the following:

  1. Go to File -> Import -> Git -> Projects from Git, press next
  2. Select URI, press next
  3. Copy "https://github.com/myusername/Ardor3D.git" to the URI field, press next, press next
  4. Select "yourbranch" as initial branch, press next, make some coffee
  5. Press cancel (we only needed to check it out on disk)

Part 2:

  1. Go to File -> Import -> Maven -> Existing Maven Projects, press next
  2. Locate the folder where you checked out Ardor3D, press finish

Notes on Macintosh

To run the SWT examples, you have to add -XstartOnFirstThread to the run config.

TODO someone needs to check this on a mac with the new project reorganization

Note: the cocoa jar is named differently because eclipse auto-adds “start on first thread” to your runtime if you have an “swt.jar” file in your path. This causes the mac to go nuts when you are running from eclipse.

Also of note: the naming workaround allows the non-swt examples to all work on mac, but the swt examples will not work out of the box. You can get these to work by adding the -XstartOnFirstThread option to the run config, but really, I'm sure there's a better way. Hopefully we can get a mac-swt guru to help us sometime.