Setup Mondrian on Mac OSX

Posted by & filed under Code, Java, Work.

The Mondrian documentation is terrible, and Java isn’t something you get to easily “dabble” in.  My goal was to setup Mondrian on my Mac OSX machine, starting with Mondrian 3.5.  While trying to set up the initial FoodMart sample dataset I ran into a bunch of java errors, always something like

Exception in thread "main" java.lang.NoClassDefFoundError: mondrian/test/loader/MondrianFoodMartLoader
Caused by: java.lang.ClassNotFoundException: mondrian.test.loader.MondrianFoodMartLoader

Based on various forum posts and other blog posts, I found this to be the most direct route to get it installed. This is all assuming you have your JDK up to date…

  1. Install Tomcat 7
  2. Download Mondrian (3.5.0 – I didn’t see the starter .sql script in the /demo folder, so I opted for 3.4.1 at first)
  3. DEPLOY THE MONDRIAN WEBAPP.  Once Tomcat is up, copy from the mondrian download /lib/mondrian.war to the “webapps” directory for tomcat.  If you follow the steps in the Tomcat install I linked to, this will be /Library/Tomcat/webapps.  This will unpack the app into /Library/Tomcat/webapps/mondrian

You should now be ready to run the java command to build your sample dataset as in:

The sample command usually looks like:

$ java -cp "/mondrian/lib/mondrian.jar:/mondrian/lib/log4j.jar:/mondrian/lib/commons-logging.jar:/mondrian/lib/eigenbase-xom.jar:/mondrian/lib/eigenbase-resgen.jar:/mondrian/lib/eigenbase-properties.jar:/usr/local/mysql/mysql-connector-java-5.0.5-bin.jar"
     -verbose -tables -data -indexes

Horrific example since it doesn’t talk about where you should be running this from, or where any of these .jar files should be…  Since you’ve deployed the web-app, we can make our lives easier by including the /lib directory of the web app in the classpath.  NOTE: you may need to manually download your jdbc database driver, sticking it in the Tomcat /lib for your mondrian web-app keeps things simple.   Also – note the “inputFile” parameter, this should be set to the location of the “FoodMartCreateData.sql” script, usually in the “demo” folder in the Mondrian download.  Just pay attention to where the file is or where you run the script from and you should be fine.

$ java -cp "/Library/Tomcat/webapps/mondrian/WEB-INF/lib/*"
     -verbose -tables -data -indexes

After this I follwed the rest of the setup instructions (modifiation of the web.xml file and a few of the .jsp pages), and I was able to pivot away in the browser…


2 Responses to “Setup Mondrian on Mac OSX”

  1. Luc Boudreau

    Hello Garrett, sorry you ran into these issues. Here are a few quick tips which I’m sure you’ll wish you had known beforehand.

    Here’s how to get started wiht Mondrian in a jiffy.

    1. Clone our Git repository (or fork & clone)

    git clone

    2. Create a file at the root of the project. Call it ‘’ and add this. Tweak it as needed. It doens’t have to be MySQL.


    3. Compile it. If you run into issues about JAVA_HOME, pop open and look for a section where you can add your own paths.

    ant jar

    4. Load the demo database. It’ll use the properties you have defined above. You could also use the low level loader classes, but you don’t really have to.

    ant load-foodmart

    5. Make your changes and run some tests.

    ant junit-main

    For all the finicky details read these.

    Git workflow:

    Dev guide:


Leave a Reply