Skip to content

Building Neo4j

linuxonz edited this page Nov 28, 2024 · 52 revisions

Building Neo4j

General Notes:

  • When following the steps below, please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Note: Neo4j (v5.25.1) was verified at the time of creation of these instructions

1. Install dependencies

export SOURCE_ROOT=/<source_root>/
export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/dockerfile-examples/master/Neo4j"
  • RHEL (8.8, 8.10, 9.2, 9.4)

    sudo yum install -y git wget tar
    
  • SLES 15 (SP5, SP6)

    sudo zypper install -y git wget tar
    
  • Ubuntu (20.04, 22.04, 24.04, 24.10)

    sudo apt-get update
    sudo apt install -y git wget tar
    
  • Install Maven

    cd $SOURCE_ROOT
    wget https://archive.apache.org/dist/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
    tar -zxf apache-maven-3.9.9-bin.tar.gz
    export PATH=$SOURCE_ROOT/apache-maven-3.9.9/bin:$PATH
    export MAVEN_OPTS="-Xmx2048m -Xss8m"

2. Install Java

  • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

    • Download and install Eclipse Adoptium Temurin Runtime (Java 17 or 21) from here.
  • With OpenJDK 17

    • RHEL (8.8, 8.9, 9.2, 9.4)
      sudo yum install -y java-17-openjdk-devel
    • SLES 15 (SP5, SP6)
      sudo zypper install -y --auto-agree-with-licenses java-17-openjdk java-17-openjdk-devel
    • Ubuntu (20.04, 22.04, 24.04, 24.10)
      sudo apt-get install -y openjdk-17-jdk
  • With OpenJDK 21

    • RHEL (8.8, 8.9, 9.2, 9.4)
      sudo yum install -y java-21-openjdk-devel
    • SLES 15 SP6
      sudo zypper install -y --auto-agree-with-licenses java-21-openjdk java-21-openjdk-devel
    • Ubuntu (20.04, 22.04, 24.04, 24.10)
      sudo apt-get install -y openjdk-21-jdk

Note: Versions (v17.0.13 and v21.0.5) of Adoptium Temurin Runtime were used at the time of creation of these instructions.

3. Set Environment variables

export JAVA_HOME=<path to installed java>
export PATH=$JAVA_HOME/bin:$PATH

4. Build Neo4j

cd $SOURCE_ROOT
git clone -b 5.25.1 https://github.com/neo4j/neo4j.git
cd neo4j
curl -sSL $PATCH_URL/neo4j-5.25.1.patch | git apply -
mvn clean install -DskipTests

The resulting binary tarball can be found in $SOURCE_ROOT/neo4j/packaging/standalone/target.

5. Run test (optional)

cd $SOURCE_ROOT/neo4j
mvn install -fn -B -V

Test failures on both x86_64 and s390x with same error.

  • Neo4j - Community Server Assembler
  • Neo4j - Cypher Shell

Note: Test failures are observed in neo4j/community/community-it/bolt-it module as it uses hard coded x86 specific test data.

  • Neo4j - Community Bolt Integration Tests

6. Start server

Extract binary tarball to $SOURCE_ROOT:

export NEO4J_HOME=$SOURCE_ROOT/<Neo4j_binary_folder>

cd $SOURCE_ROOT
tar zxf $SOURCE_ROOT/neo4j/packaging/standalone/target/<Neo4j_tarball> -C $NEO4J_HOME
wget https://repo1.maven.org/maven2/org/neo4j/client/neo4j-browser/5.24.0/neo4j-browser-5.24.0.jar -P $NEO4J_HOME/lib

To start the server, follow steps given below.

cd $NEO4J_HOME
bin/neo4j start
bin/neo4j status
bin/neo4j stop

References:

Clone this wiki locally