Skip to content

Setting up IntelliJ IDEA

Alexandre Cançado Cardoso edited this page Aug 9, 2013 · 3 revisions

for developing DBpedia Spotlight.

Download IDEA

from http://www.jetbrains.com/idea/download/index.html

Java (JDK) must be installed for installing IDEA. Download (http://www.oracle.com/technetwork/java/javase/downloads/index.html) and install the recent version.

If you are using Linux, you may have some difficulty to install the jdk. So follow this tutorial (for Ubuntu): http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html

(The guide below was created using version 11.1.1 of IDEA.)

Install the Scala Plugin

On the start screen (when all projects are closed), on the top right corner:

Open Plugin Manager > Browse repositories > search for Scala > right-click on Scala > Download and install > Restart (For new version of IDEA,configure > plugins >search for Scala > right-click on Scala > Download and install > Restart).

Set up Maven

Please install Maven3. Builds with Maven2 are not supported any more.

You will need to set up M2_HOME (yes, even if it is Maven3) as an environment variable in your ~/.bashrc and/or ~/.profile, or the path to your Maven home directory in IDEA under File > Settings > Maven > Maven home directory

Checkout Code

VCS > Checkout from version control > Git > [email protected]:dbpedia-spotlight/dbpedia-spotlight.git

Create project

File > New project... > Import project from external model > Maven > Root directory: $PATH_TO_DBPEDIA_SPOTLIGHT_CODE (For new version of IDEA,import project > choose path > Import project from external model > Maven) Tick "Import maven projects automatically"

Next > Next > Finish

Build project

Do Not build the project directly by Build->Rebuild Project. Otherwise, you would get building errors as shown in the following figure. Instead, go to right bar of Intellij, open 'Maven Projects', then open 'DBpedia Spotlight annotation framework (parent POM)' > 'Lifecycle' and double-click install. building error

Next steps

IntelliJ should handle all Maven dependencies correctly. If it does not, build the project with Maven outside of IDEA.

Tips for using IntelliJ

Mac OS X

If you use Mac OS X, you will likely have bad font rendering in IntelliJ. To fix this, edit the file /Applications/IntelliJ IDEA 11 CE.app/Contents/Info.plist by adding -Dawt.useSystemAAFontSettings=lcd to VMOptions. For example:

<key>VMOptions.x86_64</key>
<string>-Xms128m -Xmx800m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=64m -XX:+UseCompressedOops -Dawt.useSystemAAFontSettings=lcd</string>
Clone this wiki locally