All platforms require a Java installation, with JDK 1.8 or more recent version.
Set the JAVA_HOME environment variable. For example:
Platform | Command |
---|---|
Unix | export JAVA_HOME=/usr/java/jdk1.8.0_121 |
OSX | export JAVA_HOME=`/usr/libexec/java_home -v 1.8` |
Windows | set 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.
The following steps have been tested with IntelliJ IDEA 2020.3.3
-
Run
./gradlew --parallel generate
from Geode repository root to create compiler generated source. -
Import the project into IntelliJ IDEA.
- Select File -> Open... from the menu.
- Select the
build.gradle
file in the Geode repository root and select Open. - In the Open Project? popup, select Open Project.
- In the Trust and Open Gradle Project? popup, select Trust Project.
- Wait for IntelliJ to import the project and complete its background tasks.
-
Configure IntelliJ IDEA to build and run the project and tests.
-
Set the Java SDK for the project.
- Select File -> Project Structure... from the menu.
- Open the Project Settings -> Project section.
- Set Project SDK to your most recent Java 1.8 JDK.
-
To automatically re-generate sources when needed (recommended).
- Select View -> Tool Windows -> Gradle from the menu.
- In the Gradle dockable, open geode -> Tasks -> build.
- Right click the generate task and select Execute Before Sync.
- Right click the generate task and select Execute Before Build.
-
To reload the project when build scripts change (recommended).
- Select IntelliJ IDEA -> Preferences... from the menu.
- Open the Build, Execution, Deployment -> Build Tools section.
- Set Reload project after changes in the build scripts: to Any changes.
-
To build and run with Gradle (recommended).
- Select IntelliJ IDEA -> Preferences... from the menu.
- Open the Build, Execution, Deployment -> Build Tools -> Gradle section.
- Set Build and run using: to Gradle.
- Set Run tests using: to Gradle.
-
-
Set the Code Style Scheme to GeodeStyle.
- Select IntelliJ IDEA -> Preferences...
- Open the Editor -> Code Style section.
- If GeodeStyle style does not appear in the Scheme drop-down box
- Select the gear icon next to the drop-down.
- Select Import Scheme -> IntelliJ IDEA code style XML.
- Select
etc/intellij-java-modified-google-style.xml
from the Geode repository root. - Enter To: GeodeStyle, check Current scheme, and press OK.
- Select GeodeStyle in Scheme drop-down box.
-
Make Apache the default Copyright.
- Select IntelliJ IDEA -> Preferences... from the menu.
- Open the Editor -> Copyright section.
- If Apache does not appear in the Default project copyright drop-down box:
- Open the Copyright Profiles subsection.
- Select the "import" icon (the small arrow pointing down and to the left) from the Copyright Profiles section's toolbar.
- Select
etc/intellij-apache-copyright-notice.xml
from the Geode repository root. - Return to the Copyright section.
- Select Apache in the Default project copyright drop-down box.
- Open the Formatting subsection.
- Uncheck Add blank line after and select OK.
-
Rebuild the Project.
- 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.