Setup of the development environment

Prepare for developing for the IntelliJ AsciiDoc plugin.

Choosing a Java Version and Distribution

Starting with IntelliJ 2024.2, JDK 21 is required to build the plugin, as IntelliJ 2024.2 uses JDK 21. The runtime version of the plugin is still compatible with JDK 17. See the JDK 21 announcement in the JetBrains blog for details.

The AsciiDoc plugin uses only language features of Java 17 to allow the built plugin to run with earlier versions of IntelliJ as well.

JetBrains recommends Amazon Corretto JDK for development, but other distributions based on OpenJDK should work as well.

Setup IntelliJ

In IntelliJ, go to File  Project Structure…​  Project Settings  Project  SDK and select coretto-21 as the JDK.

Setup Gradle

For the Gradle build tool to pick up the Java version, point the environment variable JAVA_HOME to the folder with the JDK:

Setting the environment variable on Linux/MacOS
export JAVA_HOME=...
Setting the environment variable on Windows
JAVA_HOME=c:\workspace\...

Verify the Gradle environment

Developers can check their environment using the following command in the root folder of the project:

Linux/MacOS command
./gradlew --version
Windows command
gradlew --version

The output should be similar to:

------------------------------------------------------------
Gradle ...
------------------------------------------------------------

Build time:   ...
Revision:     ...

Kotlin:       ...
Groovy:       ...
Ant:          ...
JVM:          21.0.x (Amazon.com Inc. 21.0....)
OS:           ...