Skip to content

Commit e446cd8

Browse files
authored
DOCCORE-293 fixed error in debian installs. Updated java instructions to j21 (#3067)
1 parent 3a2e345 commit e446cd8

1 file changed

Lines changed: 18 additions & 41 deletions

File tree

modules/ROOT/pages/installation/linux/debian.adoc

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ You can install Neo4j on Debian, and Debian-based distributions like Ubuntu, usi
88
== Java prerequisites
99

1010
Neo4j {neo4j-version} requires the Java 17 runtime.
11-
Java 17 is not included in Ubuntu 16.04 LTS and will have to be set up manually before installing or upgrading to Neo4j {neo4j-version}, as described below.
12-
Debian 11 and Ubuntu 18.04 onwards already have the OpenJDK Java 17 package available through `apt`.
13-
From version 5.14 onwards, Neo4j also supports JDK 21.
11+
From version 5.14 onwards, Neo4j also supports Java 21.
1412

1513
[[debian-prerequisites-notopenjdk]]
1614
=== Oracle JDK, Zulu JDK, or Corretto JDK
@@ -25,25 +23,10 @@ Download and installation instructions can be found on the manufacturer's websit
2523
* https://aws.amazon.com/corretto/[Amazon Corretto JDK]
2624

2725

28-
[[ubuntu-java17]]
29-
=== OpenJDK 17 on Ubuntu 16.04
30-
31-
Add the official OpenJDK package repository to `apt`:
32-
33-
[source, shell]
34-
----
35-
sudo add-apt-repository -y ppa:openjdk-r/ppa
36-
sudo apt-get update
37-
----
38-
39-
You are now ready to install Neo4j, which will install Java 17 automatically if it is not already installed.
40-
See xref:installation/linux/debian.adoc#multiple-java-versions[Dealing with multiple installed Java versions] to make sure you can start Neo4j after installation.
41-
42-
4326
[[multiple-java-versions]]
4427
=== Dealing with multiple installed Java versions
4528

46-
You must configure your default Java version to point to Java 17, or Neo4j {neo4j-version-exact} will be unable to start.
29+
You must configure your default Java version to point to Java 17 or 21, or Neo4j {neo4j-version-exact} will be unable to start.
4730
Do so with the `update-java-alternatives` command.
4831

4932
. List all your installed versions of Java with `update-java-alternatives --list`.
@@ -52,27 +35,21 @@ Your results may vary, but this is an example of the output:
5235
+
5336
[queryresult]
5437
----
38+
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
5539
java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64
56-
java-1.11.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.11.0-openjdk-amd64
40+
java-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64
5741
----
5842

59-
. Identify your Java 17 version:
60-
+
61-
[source, shell]
62-
----
63-
java -version
64-
----
65-
+
66-
In this case, it is `java-1.17.0-openjdk-amd64`.
43+
. Identify your Java 21 version, in this case, it is `java-1.21.0-openjdk-amd64`.
6744

68-
. Set it as the default by replacing `<java17name>` with its name:
45+
. Set it as the default by replacing `<java21name>` with its name:
6946
+
7047
[source, shell]
7148
----
72-
sudo update-java-alternatives --jre --set <java17name>
49+
sudo update-java-alternatives --jre --set <java21name>
7350
----
7451

75-
. Confirm which version of Java is the default using `java -version` again.
52+
. Confirm which version of Java is the default using `java -version`.
7653

7754
[[debian-installation]]
7855
== Installation
@@ -108,7 +85,7 @@ sudo chmod a+r /etc/apt/keyrings/neotechnology.gpg
10885
+
10986
[source,bash]
11087
----
111-
echo 'deb [signed-by=/etc/apt/keyrings/neotechnology.gpg] https://debian.neo4j.com stable 5.26' | sudo tee -a /etc/apt/sources.list.d/neo4j.list > /dev/null
88+
echo 'deb [signed-by=/etc/apt/keyrings/neotechnology.gpg] https://debian.neo4j.com stable 5' | sudo tee -a /etc/apt/sources.list.d/neo4j.list > /dev/null
11289
----
11390
. Update package lists:
11491
+
@@ -190,38 +167,38 @@ echo "neo4j-enterprise neo4j/license note" | sudo debconf-set-selections
190167
[[debian-install-newer-java]]
191168
=== Verify the Java version
192169

193-
On newer Debian or Ubuntu operating systems, Java 19 is available by default, and `apt` may install OpenJDK 19, *even if you have Java 17 installed*.
170+
On newer Debian or Ubuntu operating systems, Java 25 is available by default, and `apt` may install OpenJDK 25, *even if you have Java 21 installed*.
194171

195172
If this happens, Neo4j will return the following warning on start:
196173
[output]
197174
----
198175
WARNING! You are using an unsupported Java runtime.
199-
* Please use Oracle(R) Java(TM) 17, OpenJDK(TM) 17 to run Neo4j.
176+
* Please use Oracle(R) Java(TM) 25, OpenJDK(TM) 25 to run Neo4j.
200177
* Please see https://neo4j.com/docs/ for Neo4j installation instructions.
201178
----
202179

203-
To fix this, you can install Java 17 manually and then either uninstall OpenJDK 19 or set Java 17 as the default.
180+
To fix this, you can install Java 21 manually and then either uninstall OpenJDK 25 or set Java 21 as the default.
204181

205-
. Run the following command to install OpenJDK 17 manually:
182+
. Run the following command to install OpenJDK 21 manually:
206183
+
207184
[source, shell, subs="attributes"]
208185
----
209-
sudo apt install openjdk-17-jre
186+
sudo apt install openjdk-21-jre
210187
----
211188
+
212-
For other distributions of Java 17, see
189+
For other distributions of Java, see
213190
xref:installation/linux/debian.adoc#debian-prerequisites-notopenjdk[Java prerequisites].
214191

215192
. Choose one of the following options to set it as the default:
216193
+
217-
* Uninstall OpenJDK 19:
194+
* Uninstall OpenJDK 25:
218195
+
219196
[source, shell, subs="attributes"]
220197
----
221-
sudo apt remove openjdk-19-jre-headless
198+
sudo apt remove openjdk-25-jre-headless
222199
----
223200

224-
* If you want to keep OpenJDK 19 installed, set Java 17 as default by following the instructions in
201+
* If you want to keep OpenJDK 25 installed, set Java 21 as default by following the instructions in
225202
xref:installation/linux/debian.adoc#multiple-java-versions[Dealing with multiple installed Java versions].
226203

227204

0 commit comments

Comments
 (0)