# IntelliJ Setup This document contains some examples and instructions on how to get IntelliJ setup to run local debugging and test setups of Druid. ## Project SDK The "SDK", configured for the Druid project, *must* be called `1.8`, to avoid annoying changes of [`.idea/misc.xml`](/.idea/misc.xml) file, that you shouldn't check into your commits. If you don't have an SDK on your dev machine with this name, you should either rename one of the existing SDKs to `1.8`, or create another one with this name, and it could point to the same files as some other existing SDK, even if it's actually JDK 9+. `1.8` is just an alias name. You can do this in Using `File` -> `Project Structure...` -> `Platform Settings` -> `SDKs` (see also [IntelliJ help page about this](https://www.jetbrains.com/help/idea/configuring-intellij-platform-plugin-sdk.html)): ![IntelliJ SDK Config](intellij-sdk-config.jpg) ## Code Style The Code Style is available in XML format at [druid_intellij_formatting.xml](druid_intellij_formatting.xml) and can be [imported into IntelliJ](https://www.jetbrains.com/help/idea/2017.1/copying-code-style-settings.html). ## Metadata The installation of a MySQL metadata store is outside the scope of this document, but instructions on setting up MySQL can be found at [docs/development/extensions-core/mysql.md](/docs/development/extensions-core/mysql.md). This assumes you followed the example there and have a database named `druid` with proper permissions for a user named `druid` and a password of `diurd`. Use of other databases such as Postgres or Derby are entirely reasonable, but doing so is left as an excercise to the reader. ## ZooKeeper This also assumes you have [ZooKeeper](http://zookeeper.apache.org/releases.html) running locally, which usually just involves downloading the latst distribution of ZooKeeper, doing some minor configuration in ZooKeeper's `conf/` directory (most defaults are fine), then running `./bin/zkServer.sh start` in the ZooKeeper directory. ## Initial Build Before running the apps, you should do a `mvn clean install -DskipTests` in the Druid source in order to make sure directories are populated correctly. ## XML App Def You can configure application definitions in XML for import into IntelliJ. Below are a few examples. These should be placed in an XML file in `.idea/runConfigurations` in the Druid source code. ### Historical.xml ```xml ``` ### Coordinator.xml ```xml ```