Configuring Eclipse for MXJ


In this tutorial, Nick Rothwell will lead us through the process of setting up the powerful Eclipse IDE for creating MXJ objects for Max.

Here we go…

Setting up the Eclipse Project

I’m assuming that the workspace will be in /Users/~~username~~/workspace – if not, make the necessary alterations. I’m working on OS X, but this should all be pretty similar for Linux or other host systems.

I like to start with a CVS repository before doing anything else. Then: in Eclipse, select ~~new project~~, and attach it to the appropriate directory in the CVS repository. Eclipse will offer the option of selecting a project type via a wizard: select “Java Project”. I also select the option for separate source and output folders (since my sensibilities are somewhat offended by having them in the same place).

For a project called MXJ, Eclipse nominates MXJ/src as the build folder, but this can be removed and replaced with others (via the project properties). The default output folder will be MXJ/bin (which I don’t object to).

(It appears to be fairly arbitrary where the mount points of the CVS repository are selected: there’s obviously an interaction between the mount point and the project source directories. If the mount point is too high, the project contains lots of junk; if it’s too low the projects cease to be self-sufficient, and some projects then need to include others.)

Max/MSP Linkage

With these folders set up, Eclipse will by default start auto-compiling stuff – and it’ll fail to find the MXJ libraries. Pull up the project properties, select java build path, add external JARs, and add max.jar from /Library/Application Support/Cycling ’74/java/lib. (To develop on another machine, such as a Linux host, copy the max.jar file there.)

Edit the Max/MSP MXJ configuration file (/Library/Application Support/Cycling ’74/java/max.java.config.txt), and add the Eclipse output directories as max.dynamic.class.dir entries. (It appears that a trailing “/” is needed to allow any kind of auto-reloading.)