When it comes to working with the MicroStrategy SDK there is a lot of resources out there, however, when it comes to getting started and setting up your devlopment environment, you may find that the instructions are often lacking and disjointed.
I find there are primarily two different buckets developers fall into when it comes to SDK development. First, there are those that want to modify the existing MicroStrategy web application and second, there are those that want to incorporate MicroStrategy into their own existing custom web applications. The main focus of this post is the latter.
When setting up my development environment using Eclipse I ran into several issues that had me pounding my fists against the desk. I scoured the internet only to find that the documentation was either limited or dated. It seems like I was fighting through hurdle after hurdle until finally I was able to get everything working.
I decided to create this post to help others that would like to get started with MicroStrategy SDK development.
So let’s jump right in and get started.
Step 1 – Install Java SDK 8 from here (Make sure you install JDK and not just JRE)
Step 2 – Download and extract the Eclipse Java IDE from here. I’m currently working with MicroStrategy 10.2 and use Eclipse Mars.
Step 3 – Open Eclipse and click Help->Install new software…
In the “work with” drop down choose “http://download.eclipse.org/releases/mars” and check the following packages to install:
- Eclipse Java Web Developer Tools
- JST Server Adapters
- JST Server Adapters Extensions
- Eclipse Java EE Developer Tools
- WST Server Adapters
Step 4 – Download and install Apache Tomcat from here (I use Tomcat version 7). We are installing Tomcat to your development environment but if you have experience developing Java web applications you may want to skip this step however, this is for beginners so I assume nothing.
After Tomcat is installed go to the install directory for example “C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\conf” and edit “tomcat-users.xml” file and add users and roles. See the example screenshot below.
Step 5 – Configure the Tomcat run time with Eclipse
- In Eclipse click Window-Preferences->Server->Runtime Environment
- Click Add->Click Apache Tomcat v7.0->Click Next
- Click Browse… and choose C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0
- Choose java8 (JDK) in the JRE dropdown
- Click Finish then OK
Step 6 – Now for the fun part where we create a new web project and integrate with MicroStrategy SDK.
- In Eclipse Click File->New->Project->Web->Dynamic Web Project->Click Next
- Enter project name and choose runtime module version 2.5. See screenshot below for an example. (Note: Target runtime should default to Apache Tomcat v7.0)
3. Click next, then next again, then finish
4. Go to Project->Properties->Choose “Java Build Path” from left tree view
5. Click Libraries tab and click Add external jars
6. Add MicroStrategy JAR files. These files can be obtained from an existing MicroStrategy installation. In Windows they can be found in “C:\Program Files (x86)\Common Files\MicroStrategy” for example. NOTE: Make sure you ONLY add the files that are named like Web*.jar and the file JavaWebAPI.jar
7. Click Apply and OK
8. After you created the project next go to Project->Properties->Deployment Assembly and add the MicroStrategy jar files. NOTE: THIS IS REQUIRED OR THE DEPLOYED APP WILL FAIL TO FIND THE MICROSTRATEGY JAR FILES AND THE APP WILL NOT WORK!
Congratulations! You now have a MicroStrategy development environment and are ready to begin developing custom Java applications that integrate with MicroStrategy.
In Part 2 of this post I show you how to connect to MicroStrategy, run a report, retrieve the results as XML, parse the results and finally display the report results to a user from a custom Java web application. For that post I will of course be using a development environment that was setup with these very same instructions.