This article shows you how to configure Eclipse to develop MATSim. Eclipse is a powerful, open source development platform with excellent support for Java development. Note that Eclipse is neither required to use MATSim, nor is it the only development environment MATSim works with. It is just one of the many widely used tools by Java developers which we have good experience with.
MATSim uses Subversion (SVN) as code repository. Currently, there are two well-known plugins that bring svn-functionality to Eclipse:
Both plugins offer very similar features. Install one of them according to their installation instructions. For this article, Subclipse was used, but Subversive should work very similar, so you're free to choose whichever you want.
https://matsim.svn.sourceforge.net/svnroot/matsim" and click "Next".matsim/trunk" and click "Next".If a warning shows, that some files may be overwritten, click "OK".
The project is now checked out from the repository, this is likely to take some minutes to finish.
** Note: MATSim also provides a Makefile for command line compilation (i.e. make clean ; make compile ; make run). There, the default class folder is defined as matsim/classes. So---for convenience---we use the same in the eclipse environment.
MATSim uses several libraries, which must be added to the build path to successfully compile MATSim. All the libraries are located in the directory libs. Add them to the build path. Maybe the easiest way to do this is to open the Project Properties (Menu Project > Properties), select "Java Build Path", "Libraries", than "Add JARs". Select all the files in libs and click "OK".
Note that you also have to add the bunch of .jar files in the subdirectories of libs except those in libs/source. E.g. add all .jar files of the libs/geotools folder.
MATSim includes a growing list of unit tests based on JUnit.
Open the Project Properties (Menu Project > Properties), than select "Java Build Path".
In "Source", click on "Add Folder..." and activate the tick at "test/src", click "OK".
Change to "Libraries" and click on "Add Library...". Choose JUnit, and when asked decide for JUnit 3, not for JUnit 4.
Click "OK" to close the Project Properties.