corda/docs/source/getting-set-up-fault-finding.rst

85 lines
5.1 KiB
ReStructuredText

Troubleshooting
===============
Milestone releases
------------------
When you clone the corda or cordapp-template repos, they will default to the master branch. The master branch is being continuously developed upon, and its features may not align with the state of Corda as described in the docs. Additionally, the master branch of the CorDapp template may break in response to changes in the main corda repo.
When developing on Corda, you should always check out the latest milestone (i.e. stable) branch instead. For example, to check out milestone 0, you'd run ``git checkout release-M0``.
Java issues
-----------
Outdated/non-Oracle JDKs
************************
Many users have faced issues when running versions of Java that are either outdated, or are produced by organisations other than Oracle (e.g. OpenJDK). The errors generated by these issues will not always clearly point to the JDK as the cause. If in doubt, check your JDK version by following the instructions `here <https://java.com/en/download/help/version_manual.xml>`_. You can download the latest version of Oracle's JDK `here <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_.
"Unresolved reference: javafx"
******************************
JavaFX is not bundled with OpenJDK. If you are using OpenJDK and get an 'Unresolved reference: javafx' error, this means that you need to install OpenJFX.
If you have APT installed and OpenJFX is part of your Unix distribution's package list, you can do this by running ``sudo apt install openjfx``, and possibly ``sudo apt install libopenjfx-jav``. Other users will want to refer to the guide `here <https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX>`_, or to the list of Community Builds `here <https://wiki.openjdk.java.net/display/OpenJFX/Community+Builds>`_.
IDEA issues
-----------
No source files are present
***************************
When opening a project in IDEA for the first time, you will need to build the project. You should see "Unlinked Gradle project?"
in a pop-up window in the top-right corner or in a popup alert window. It will also appear in the "Event Log" window which can be
opened by clicking on "Event Log" at the bottom right of the IDEA window. Find one of these links and click on "Import Gradle Project".
.. image:: resources/unlinked-gradle.png
:height: 50 px
:width: 410 px
:alt: IDEA Gradle Prompt
Wait for it to download the dependencies. You may then see another popup titled "Unindexed remote maven repositories found." This won't affect Corda,
so you can choose to leave them unindexed.
If still have problems, the JetBrains website has more information on `here <https://www.jetbrains.com/help/idea/2016.2/working-with-gradle-projects.html>`_.
Run configurations are missing
******************************
If you opened the Corda project by clicking "Import Project" on the IDEA splash screen rather than clicking "Open", a bug
in IDEA will cause it to wipe and recreate the ``.idea`` directory where the run configurations are stored. The fix is
simple and doesn't require you to re-import the project: just undelete the files! You can do that by either:
1. Running ``git checkout .idea/runConfigurations`` to redownload the files.
2. Using the "Version Control" pane in IDEA to undelete the files via the GUI.
IDEA complains about lack of an SDK
***********************************
If IDEA refuses to open a project because an SDK has not been 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 on a path such as ``jdk1.8.0_xx…/Contents/Home``. Ensure that you have the Project language level set at 8.
If you are having trouble selecting the correct JDK, the JetBrains website provides the `following guidelines <https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under>`_.
Kotlin plugin
*************
There are two ways to configure Kotlin in IDEA:
1. Via the initial project opening screen, by using the ``Configure > Plugins`` tab.
2. From an open IDEA project, by clicking ``IDEA -> Preferences ...`` (on OS X) or ``File -> Settings`` (on Windows). Select the Plugins bar to confirm that Kotlin is installed and up-to-date.
If you are still having trouble installing Kotlin, first try upgrading the Kotlin plugin. At the time of writing, you can
identify the latest version of the Kotlin plugin on `this page <https://plugins.jetbrains.com/plugin/6954>`_.
"Unable to make the module: related gradle configuration was not found. Please, re-import the Gradle project and try again"
***************************************************************************************************************************
This can usually be solved by updating IDEA. Check that you have the latest version `here <https://www.jetbrains.com/idea/download/>`_.
Other common issues
-------------------
“xterm: command not found”
**************************
On some machines, running the samples requires xterm. You can download it `here <http://invisible-island.net/xterm/#download>`_.