Skip to content

Setting up an IntelliJ IDEA Project

kuebler edited this page Apr 19, 2012 · 2 revisions

We prefer developing with IntelliJ IDEA. It is available for OS X, Linux and Windows and the community edition is free for everyone and works great with the Scala Plugin.

Set Up IntelliJ IDEA

  1. Download and install IntelliJ IDEA
  2. Install the Scala and the sbt plugin via the Plugin Manager (under Preferences)

We assume that you already have a working copy of Warthog (see ...) on your machine.

Set Up a New IDEA Project

  1. Start IntelliJ and create a new project
  2. Choose create a new project from scratch
  3. As project name choose warthog and set the files location to your local copy of warthog. Also create a Java Module with the the name and the same location.
  4. You can let IntelliJ choose the source paths for you (which should be 3 paths, 2x Scala and 1x Java)
  5. Choose Scala under "desired technologies" and provide the path to your Scala distribution
  6. This should create a new project and index all necessary files

Configure Your Project

  1. Choose the directories .idea, target and project and mark them as excluded
  2. Choose the directory test/scala and mark it as Test Source Root
  3. Go to Project Structure
  4. Under Libraries add the following two libraries
  • Specs2 (should be in $HOME/.ivy/cache/org.specs2/.../jars)
  • JNA (should be in $HOME/.ivy2/cache/net.java.dev.jna/jna/jars/jna-3.3.0.jar)
  1. Configure SBT under Preferences / Project Settings / SBT
  • Choose the appropriate location to your sbt-launch.jar
  • Use the following VM parameters
-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M -Dwarthog.libs=$WARTHOG_HOME/lib -Dfile.encoding=UTF-8"

Alternative: sbt-idea plugin

  1. Modify the project to use the sbt-idea plugin
  2. Launch sbt, type gen-idea no-sbt-classifiers (idea-specific configuration files will be generated)
  3. Import the newly generated idea project into your IntelliJ Idea IDE

This should get you ready to develop with and for Warthog in IntelliJ IDEA.