From 45adbfff7c280137d2df5b958e3e199c49ccd6fc Mon Sep 17 00:00:00 2001 From: Reneta Popova Date: Thu, 20 Apr 2023 11:38:52 +0300 Subject: [PATCH] =?UTF-8?q?updated=20debian=20install=20instructions=20for?= =?UTF-8?q?=20if=20openjdk=2019=20gets=20installed=20=E2=80=A6=20(#714)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-picked from #700 Also added RHEL 8.8 to compatible OSs. --------- Co-authored-by: Jenny Owen --- .../ROOT/pages/installation/linux/debian.adoc | 69 +++++++++++++++---- .../ROOT/pages/installation/requirements.adoc | 2 +- 2 files changed, 55 insertions(+), 16 deletions(-) diff --git a/modules/ROOT/pages/installation/linux/debian.adoc b/modules/ROOT/pages/installation/linux/debian.adoc index 469484fb2..dc9a4b595 100644 --- a/modules/ROOT/pages/installation/linux/debian.adoc +++ b/modules/ROOT/pages/installation/linux/debian.adoc @@ -11,6 +11,7 @@ Neo4j {neo4j-version} requires the Java 17 runtime. Java 17 is not included in Ubuntu 16.04 LTS and will have to be set up manually prior to installing or upgrading to Neo4j {neo4j-version}, as described below. Debian 11 and Ubuntu 18.04 onwards already have the OpenJDK Java 17 package available through `apt`. +[[debian-prerequisites-notopenjdk]] === Oracle JDK, Zulu JDK, or Corretto JDK If you wish to use a non-default JDK, it must be installed prior to starting the Neo4j installation. @@ -44,7 +45,7 @@ See xref:installation/linux/debian.adoc#multiple-java-versions[Dealing with mult It is important that you configure your default Java version to point to Java 17, or Neo4j {neo4j-version-exact} will be unable to start. Do so with the `update-java-alternatives` command. -* First list all your installed versions of Java with `update-java-alternatives --list` +. List all your installed versions of Java with `update-java-alternatives --list`. + Your results may vary, but this is an example of the output: + @@ -54,21 +55,58 @@ java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64 java-1.11.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.11.0-openjdk-amd64 ---- -* Identify your Java 17 version, in this case, it is `java-1.17.0-openjdk-amd64`. -Then set it as the default with (replacing `` with the appropriate name from above): +. Identify your Java 17 version: + [source, shell] ---- -sudo update-java-alternatives --jre --set +java -version ---- ++ +In this case, it is `java-1.17.0-openjdk-amd64`. -* Finally, confirm which version of Java is the default: +. Set it as the default by replacing `` with its name: + [source, shell] ---- -java -version +sudo update-java-alternatives --jre --set +---- + +. Confirm which version of Java is the default using `java -version` again. + +[[debian-install-newer-java]] +=== If `apt` installed OpenJDK 19 + +On newer Debian or Ubuntu operating systems, Java 19 is available by default, and `apt` may have installed OpenJDK 19, *even if Java 17 was already installed*. + +If this happens, you will see this warning on Neo4j start: +[output] +---- +WARNING! You are using an unsupported Java runtime. +* Please use Oracle(R) Java(TM) 17, OpenJDK(TM) 17 to run Neo4j. +* Please see https://neo4j.com/docs/ for Neo4j installation instructions. ---- +To fix this, you can install Java 17 manually, uninstall OpenJDK 19, or set Java 17 as the default. + +* Install OpenJDK 17 manually: ++ +[source, shell, subs="attributes"] +---- +sudo apt install openjdk-17-jre +---- ++ +For other distributions of Java 17, see +xref:installation/linux/debian.adoc#debian-prerequisites-notopenjdk[instructions for setting up java pre-requisites]. + +* Uninstall OpenJDK 19: ++ +[source, shell, subs="attributes"] +---- +sudo apt remove openjdk-19-jre-headless +---- + +* Alternatively, if you want to keep OpenJDK 19 installed, follow the instructions in the section for +xref:installation/linux/debian.adoc#multiple-java-versions[Dealing with multiple installed Java versions] to set Java 17 as the default java version. [[debian-installation]] == Installation @@ -79,7 +117,7 @@ java -version The Debian package is available from https://debian.neo4j.com. -* To use the repository for generally available versions of Neo4j, run: +. To use the repository for generally available versions of Neo4j, run: + [source, shell] ---- @@ -100,7 +138,7 @@ echo 'deb https://debian.neo4j.com stable {neo4j-version}' | sudo tee -a /etc/ap sudo apt-get update ---- -* Once the repository has been added into `apt`, you can verify which Neo4j versions are available by running: +. Once the repository has been added to `apt`, you can verify which Neo4j versions are available by running: + [source, shell] ---- @@ -109,7 +147,7 @@ apt list -a neo4j + [NOTE] ==== -In Ubuntu server installations you will also need to make sure that the `universe` repository is enabled. +In Ubuntu server installations, you also need to make sure that the `universe` repository is enabled. If the `universe` repository is not present, the Neo4j installation will fail with the error `Depends: daemon but it is not installable`. This can be fixed by running the command: @@ -123,21 +161,23 @@ sudo add-apt-repository universe [[debian-install]] === Install Neo4j -To install Neo4j Community Edition: +To install Neo4j, run one of the following commands depending on which version you want to install: +* Neo4j Community Edition: ++ [source, shell, subs="attributes"] ---- sudo apt-get install neo4j=1:{neo4j-version-exact} ---- -To install Neo4j Enterprise Edition: - +* Neo4j Enterprise Edition: ++ [source, shell, subs="attributes"] ---- sudo apt-get install neo4j-enterprise=1:{neo4j-version-exact} ---- -Note that the version includes an epoch version component (`1:`), in accordance with the https://www.debian.org/doc/debian-policy/#s-f-version[Debian policy on versioning]. +Note that the version includes an epoch version component (`1:`), following the https://www.debian.org/doc/debian-policy/#s-f-version[Debian policy on versioning]. When installing Neo4j Enterprise Edition, you will be prompted to accept the license agreement. Once the license agreement is accepted installation begins. @@ -150,7 +190,6 @@ To forget the stored answer, and trigger the license agreement prompt on subsequ echo purge | sudo debconf-communicate neo4j-enterprise ---- - [role=enterprise-edition] ==== Non-interactive installation of Neo4j Enterprise Edition @@ -247,7 +286,7 @@ On Debian-based distributions, Neo4j is enabled to start automatically on system Before starting up the database for the first time, it is recommended to use the `set-initial-password` command of `neo4j-admin` to define the password for the native user `neo4j`. If the password is not set explicitly using this method, it will be set to the default password `neo4j`. -In that case, you will be prompted to change the default password at first login. +In that case, you will be prompted to change the default password at first login. For more information, see xref:configuration/set-initial-password.adoc[]. ==== diff --git a/modules/ROOT/pages/installation/requirements.adoc b/modules/ROOT/pages/installation/requirements.adoc index 6bdb5da4a..f7e4437af 100644 --- a/modules/ROOT/pages/installation/requirements.adoc +++ b/modules/ROOT/pages/installation/requirements.adoc @@ -101,7 +101,7 @@ For cloud environments, and server-based, on-premise environments: | *Amazon Linux 2022 AMI* | Amazon Corretto 17, and OracleJDK 17 | *CentOS Stream 8, 9* | OpenJDK 17, OracleJDK 17, and ZuluJDK 17 | *Debian 11* | OpenJDK 17, OracleJDK 17, and ZuluJDK 17 -| *Red Hat Enterprise Linux Server 8.4, 8.6, 9.0* | Red Hat OpenJDK 17, Oracle JDK 17, and ZuluJDK 17 +| *Red Hat Enterprise Linux Server 8.6, 8.8, 9.0* | Red Hat OpenJDK 17, Oracle JDK 17, and ZuluJDK 17 | *Ubuntu Server 16.04, 18.04, 20.04, 22.04* | OpenJDK 17, OracleJDK 17, and ZuluJDK 17 | *Windows Server 2016, 2019, 2022* | OracleJDK 17, ZuluJDK 17 |===