Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Setting up IntelliJ IDEA (Linux, WIndows, OSX)

Stephan Bauer edited this page May 8, 2016 · 4 revisions

Warning: This seems to work fine for OSX but IntelliJ seems to have problems on Linux.

Clone the repository

git clone https://github.com/jsettlers/settlers-remake.git # clone the repository
cd settlers-remake                                         # change into the settlers remake folder

This should have created a new directory: settlers-remake

Install Android SDK

Linux

Linux users download the command line tools at the bottom of the Android SDK page.

Windows

Windows users have two options:

  • download Android Studio(which can be used as alternative to IntelliJ) and install the AndroidSDK during the installation process by following the instrctions
  • or download the command line tools at the bottom of the Android SDK page.

OSX

# Mac
brew install android # install SDK Manager
android              # start SDK Manager GUI

When you have the Android SDK Manager installed...

open it and select the following packages.

Install the following items

  • Tools/Android SDK Build-tools version 23.0.1
  • Android 4.0.3 (API 15)/SDK Platform
  • Android 4.0.3 (API 15)/Google APIs
  • Android 4.0.3 (API 15)/Sources for Android SDK

Create local.properties file in settlers-remake folder to tell IntelliJ IDEA where to find the Andoid SDK.

# Mac
echo "sdk.dir=/usr/local/opt/android-sdk" >> local.properties

The file should look like this (on Windows your path will look different).

sdk.dir=/usr/local/opt/android-sdk

Start IntelliJ IDEA

Run the application once with Gradle to prepare the settlers-remake folder for IntelliJ IDEA

./gradlew run

Download the IntelliJ IDEA Community Edition and start it.

Click Import Project

Select settlers-remake/build.gradle and click OK

In Import Project from Gradle dialog click OK

In Gradle Project Data to Import dialog click OK

Run using Swing

  • In the project jsettlers.main.swing, find the class SwingManagedJSettlers.
  • Create a run configuration.
  • To prevent a NoClassDefFoundError and to run the latest code changes, edit the run configuration.
  • add a "Before launch" step by clicking the + button
  • Select "Run Gradle task"
  • Choose the root "settlers-remake" Gradle project
  • Type in the "compileJava" task (If you like to run a test, type in "compileTestJava"
  • Now you can remove the default "Make" step in "Before launch" to reduce the compile time