Skip to content

Commit

Permalink
updated debian install instructions for if openjdk 19 gets installed … (
Browse files Browse the repository at this point in the history
#714)

Cherry-picked from #700

Also added RHEL 8.8 to compatible OSs.

---------

Co-authored-by: Jenny Owen <[email protected]>
  • Loading branch information
renetapopova and jennyowen authored Apr 20, 2023
1 parent 85622bd commit 45adbff
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 16 deletions.
69 changes: 54 additions & 15 deletions modules/ROOT/pages/installation/linux/debian.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
+
Expand All @@ -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 `<java17name>` with the appropriate name from above):
. Identify your Java 17 version:
+
[source, shell]
----
sudo update-java-alternatives --jre --set <java17name>
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 `<java17name>` with its name:
+
[source, shell]
----
java -version
sudo update-java-alternatives --jre --set <java17name>
----

. 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
Expand All @@ -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]
----
Expand All @@ -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]
----
Expand All @@ -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:
Expand All @@ -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.
Expand All @@ -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

Expand Down Expand Up @@ -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[].
====
Expand Down
2 changes: 1 addition & 1 deletion modules/ROOT/pages/installation/requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
|===
Expand Down

0 comments on commit 45adbff

Please sign in to comment.