After series of disappointments, I finally figured out how to install mondrian on Mac. Definitely, the documentation at Pentaho was not helpful enough for a beginner like me. So I googled for hours to find sites that would help me. There, I found http://computersight.com/software/how-to-install-mondrian-the-complete-guide/. However, upon executing #12, I encountered this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/olap4j/mdx/IdentifierSegment at mondrian.test.loader.MondrianFoodMartLoader.(MondrianFoodMartLoader.java:100)
Caused by: java.lang.ClassNotFoundException: org.olap4j.mdx.IdentifierSegmentat java.net.URLClassLoader$1.run(URLClassLoader.java:202)at java.security.AccessController.doPrivileged(Native Method)at java.net.URLClassLoader.findClass(URLClassLoader.java:190)at java.lang.ClassLoader.loadClass(ClassLoader.java:306)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)at java.lang.ClassLoader.loadClass(ClassLoader.java:247)... 1 more
I thought I must have messed up my classpath. But after looking into it several times, I found that nothing's wrong. Finally, I tried this:
java -cp "/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/mondrian.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/log4j-1.2.8.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/eigenbase-xom.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/eigenbase-resgen.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/eigenbase-properties.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/commons-logging-1.0.4.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/commons-collections-3.1.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/olap4j.jar:/Library/Tomcat/apache-tomcat-7.0.22/webapps/mondrian/WEB-INF/lib/mysql-connector-java-5.1.6-bin.jar" mondrian.test.loader.MondrianFoodMartLoader -verbose -tables -data -indexes -jdbcDrivers=com.mysql.jdbc.Driver -inputFile=/usr/local/mondrian/demo/FoodMartCreateData.sql -outputJdbcURL="jdbc:mysql://localhost/foodmart?user=foodmart&password=foodmart"
And "Yey!", it worked! The error was caused by missing libraries (commons-collections, commons-logging, and olap4j).
Now, I'm studying how to use Mondrian and experimenting on the FoodMart demo.