2016-11-14 18:12:39 +00:00
Getting Set Up : Faultfinding
=============================
2016-11-17 16:31:08 +00:00
IntelliJ issues
---------------
2016-11-14 18:12:39 +00:00
2016-11-17 16:31:08 +00:00
If IntelliJ complains about lack of an SDK
***** ***** ***** ***** ***** ***** ***** ***** **
2016-11-14 18:12:39 +00:00
2016-11-14 18:12:39 +00:00
If on attempting to open the project (including importing Gradle project), IntelliJ refuses because an SDK was not selected,
you may need to fix the project structure. Do this by following `these instructions <https://www.jetbrains.com/help/idea/2016.2/configuring-global-project-and-module-sdks.html> `_ . The correct JDK is often found at a path such as `` jdk1.8.0_xx…/Contents/Home ``
2016-11-14 18:12:39 +00:00
2016-11-17 16:31:08 +00:00
Ensure that you have the Project language level set at as 8. If you are having trouble selecting the correct JDK, the
Jetbrains website offers the `following guidelines <https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under> `_ .
2016-11-14 18:12:39 +00:00
2016-11-17 16:31:08 +00:00
Kotlin issues
-------------
2016-11-14 18:12:39 +00:00
2016-11-17 16:31:08 +00:00
Installation
***** ***** **
2016-11-14 18:12:39 +00:00
2016-11-17 16:31:08 +00:00
There are two ways to configure Kotlin from IntelliJ. One way is via the initial project opening screen in which you will
need to use the `` Configure > Plugins `` tab. The other way is when you are in an open project, then you will need to
2016-11-14 18:12:39 +00:00
configure it via (on Mac) `` IntelliJ -> Preferences ... `` , whereas on PC it is `` File -> Settings `` . Select the plugins
2016-11-17 16:31:08 +00:00
bar, confirm that Kotlin is installed and up to date.
2016-11-14 18:12:39 +00:00
2016-11-17 16:31:08 +00:00
If you are having trouble installing Kotlin, first try upgrading the Kotlin plugin. At the time of writing, you can
confirm what is the latest version of the Kotlin plugin on `this page <https://plugins.jetbrains.com/plugin/6954> `_ .
2016-11-14 18:12:39 +00:00
Gradle issues
-------------
2016-11-14 18:12:39 +00:00
Gradle within IntelliJ
***** ***** ***** ***** **
2016-11-17 16:31:08 +00:00
After you have updated your code to the latest version from git, ensure that the gradle project is imported. Although
gradle is used via the command line, it is also integrated with IntelliJ in order for IntelliJ to determine dependencies
and index the project correctly.
When opening a project for the first time, you should see the "Unlinked Gradle project?" pop-up window in the IntelliJ top
right corner or in a popup alert window. If you miss this, it will also appear in the "Event Log" windows which can be
opened by clicking on "Event Log" at the bottom right of the IntelliJ window. Either way, click on "Import Gradle Project".
2016-11-14 18:12:39 +00:00
.. image :: resources/unlinked-gradle.png
:height: 50 px
:width: 410 px
:alt: IntelliJ Gradle Prompt
2016-11-14 18:12:39 +00:00
2016-11-20 12:12:20 +00:00
Wait for it to think and download the dependencies. After that you might have another popup titled "Unindexed remote maven repositories found." This is a general IntelliJ question and doesn't affect Corda, therefore you can decided to index them or not. Next click on the "green arrow" next to "All tests" pop-up on the top toolbar.
2016-11-14 18:12:39 +00:00
The code should build, the unit tests should show as all green.
2016-11-17 16:31:08 +00:00
If still have problems, the Jetbrains website has more information on `gradle here <https://www.jetbrains.com/help/idea/2016.2/working-with-gradle-projects.html> `_ .
2016-11-14 18:12:39 +00:00
2016-11-14 18:12:39 +00:00
Gradle via the CLI
***** ***** ***** ***
Gradle commands can also be run in the command line - further details of command line gradle can be found in
.. TODO: add gradle cmd line doc link here
2016-11-14 18:12:39 +00:00
Doing it without IntelliJ
-------------------------
If you don't want to explore or modify the code in a local IDE, you can also just use the command line and a text editor:
2016-11-14 18:12:39 +00:00
* First run `` git clone https://github.com/corda/corda `` to download Corda core source code
* Next ensure that you are in correct directory `` cd corda ``
2016-11-14 18:12:39 +00:00
* Then you can run `` ./gradlew test `` to run the unit tests.
2016-11-14 18:12:39 +00:00
2016-11-17 16:31:08 +00:00
* Finally remember to run `` git pull `` occasionally to upgrade the source code to the latest revision