Building this Release from Source

All platforms require a Java installation, with JDK 1.8 or more recent version.

Set the JAVA_HOME environment variable. For example:

PlatformCommand
Unixexport JAVA_HOME=/usr/java/jdk1.8.0_121
OSXexport JAVA_HOME=`/usr/libexec/java_home -v 1.8`
Windowsset JAVA_HOME="C:\Program Files\Java\jdk1.8.0_121"

Download the project source from the Releases page at Apache Geode, and unpack the source code.

Within the directory containing the unpacked source code, run the gradle build:

$ ./gradlew build

Once the build completes, the project files will be installed at geode-assembly/build/install/apache-geode. The distribution archives will be created in geode-assembly/build/distributions/.

Verify the installation by invoking the gfsh shell command to print version information:

$ ./geode-assembly/build/install/apache-geode/bin/gfsh version
v1.1.0

Note: on Windows invoke the gfsh.bat script to print the version string.

Setting up IntelliJ

The following steps have been tested with IntelliJ IDEA 2020.3.3

  1. Run ./gradlew --parallel generate from Geode repository root to create compiler generated source.

  2. Import the project into IntelliJ IDEA.

    1. Select File -> Open... from the menu.
    2. Select the build.gradle file in the Geode repository root and select Open.
    3. In the Open Project? popup, select Open Project.
    4. In the Trust and Open Gradle Project? popup, select Trust Project.
    5. Wait for IntelliJ to import the project and complete its background tasks.
  3. Configure IntelliJ IDEA to build and run the project and tests.

    • Set the Java SDK for the project.

      1. Select File -> Project Structure... from the menu.
      2. Open the Project Settings -> Project section.
      3. Set Project SDK to your most recent Java 1.8 JDK.
    • To automatically re-generate sources when needed (recommended).

      1. Select View -> Tool Windows -> Gradle from the menu.
      2. In the Gradle dockable, open geode -> Tasks -> build.
      3. Right click the generate task and select Execute Before Sync.
      4. Right click the generate task and select Execute Before Build.
    • To reload the project when build scripts change (recommended).

      1. Select IntelliJ IDEA -> Preferences... from the menu.
      2. Open the Build, Execution, Deployment -> Build Tools section.
      3. Set Reload project after changes in the build scripts: to Any changes.
    • To build and run with Gradle (recommended).

      1. Select IntelliJ IDEA -> Preferences... from the menu.
      2. Open the Build, Execution, Deployment -> Build Tools -> Gradle section.
      3. Set Build and run using: to Gradle.
      4. Set Run tests using: to Gradle.
  4. Set the Code Style Scheme to GeodeStyle.

    1. Select IntelliJ IDEA -> Preferences...
    2. Open the Editor -> Code Style section.
    3. If GeodeStyle style does not appear in the Scheme drop-down box
      1. Select the gear icon next to the drop-down.
      2. Select Import Scheme -> IntelliJ IDEA code style XML.
      3. Select etc/intellij-java-modified-google-style.xml from the Geode repository root.
      4. Enter To: GeodeStyle, check Current scheme, and press OK.
    4. Select GeodeStyle in Scheme drop-down box.
  5. Make Apache the default Copyright.

    1. Select IntelliJ IDEA -> Preferences... from the menu.
    2. Open the Editor -> Copyright section.
    3. If Apache does not appear in the Default project copyright drop-down box:
      1. Open the Copyright Profiles subsection.
      2. Select the “import” icon (the small arrow pointing down and to the left) from the Copyright Profiles section's toolbar.
      3. Select etc/intellij-apache-copyright-notice.xml from the Geode repository root.
      4. Return to the Copyright section.
    4. Select Apache in the Default project copyright drop-down box.
    5. Open the Formatting subsection.
    6. Uncheck Add blank line after and select OK.
  6. Rebuild the Project.

    1. Select Build -> Rebuild Project from the menu. The full project should compile without errors.

    Some optional sanity tests to make sure things are working properly:

    • Try looking up classes using Navigate -> Class...
    • Open and run a distributed test such as BasicDistributedTest in geode-core.
    • Create a new Java class and ensure the Apache license is automatically added to the top of the file with no blank line before the package line.