Skip to content

Building Neo4j

linuxonz edited this page Dec 29, 2023 · 55 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.14.0) was verified at the time of creation of these instructions

Step 1: Install dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (8.6, 8.8, 9.0, 9.2)

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

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

    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.6/binaries/apache-maven-3.9.6-bin.tar.gz
    tar -zxf apache-maven-3.9.6-bin.tar.gz
    export PATH=$SOURCE_ROOT/apache-maven-3.9.6/bin:$PATH
    export MAVEN_OPTS="-Xmx2048m -Xss8m"

Step 2: Install Java

  • RHEL (8.6, 8.8, 9.0, 9.2)

    • With Eclipse Temurin

      • Download and install Eclipse Temurin JDK (Java 17) from here.
    • With OpenJDK17

      sudo yum install -y java-17-openjdk-devel
      
  • SLES (15 SP5)

    • With Eclipse Temurin

      • Download and install Eclipse Temurin JDK (Java 17) from here.
    • With OpenJDK17

      sudo zypper install -y java-17-openjdk-devel
      
  • Ubuntu (20.04, 22.04)

    • With Eclipse Temurin

      • Download and install Eclipse Temurin JDK (Java 17) from here.
    • With OpenJDK17

      sudo apt-get update
      sudo apt-get install -y openjdk-17-jdk
      

Step 3: Set Environment variables

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

Step 4: Build Neo4j

cd $SOURCE_ROOT
git clone https://github.com/neo4j/neo4j.git
cd neo4j
git checkout 5.14.0
wget https://raw.githubusercontent.com/linux-on-ibm-z/dockerfile-examples/master/Neo4j/neo4j-5.14.0.patch -P $SOURCE_ROOT
git apply $SOURCE_ROOT/neo4j-5.14.0.patch
mvn clean install -DskipTests

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

Step 5: Run test (optional)

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

Note: Following test modules have been observed to fail on both s390x and Intel.

  • Neo4j - Community DBMS Integration Tests
  • Neo4j - Community Bolt Integration Tests

Step 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.9.0/neo4j-browser-5.9.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