Hi. I have VPS with Ubuntu Server 22.04.3 LTS and Neo4j 11.3 on it. When i start cypher-shell on server i recieve warning about Java version. Is it ok?
liv@singularity:~$cypher-shell You are using an unsupported version of the Java runtime. Please use Java(TM) 17 or Java(TM) 21. username: neo4j password: Connected to Neo4j using Bolt protocol version 5.3 at neo4j://localhost:7687 as user neo4j. Type :help for a list of available commands or :exit to exit the shell. Note that Cypher queries must end with a semicolon. neo4j@neo4j>:help
liv@singularity:~$ sudo systemctl status neo4j.service
[sudo] password for liv:
Ć neo4j.service - Neo4j Graph Database
Loaded: loaded (/lib/systemd/system/neo4j.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2023-11-08 14:38:02 +07; 2h 17min ago
Main PID: 235450 (code=exited, status=1/FAILURE)
CPU: 3.406s
Notice: journal has been rotated since unit was started, output may be incomplete.
Server is work, i cant connect to it in Neo4j Desktop the same time.
Nov 08 16:56:38 singularity systemd[1]: Started Neo4j Graph Database.
Nov 08 16:56:40 singularity neo4j[259389]: Neo4j is already running (pid:184342).
Nov 08 16:56:40 singularity neo4j[259389]: Run with '--verbose' for a more detailed error message.
Nov 08 16:56:40 singularity systemd[1]: neo4j.service: Main process exited, code=exited, status=1/FAILURE
Nov 08 16:56:40 singularity systemd[1]: neo4j.service: Failed with result 'exit-code'.
Nov 08 16:56:40 singularity systemd[1]: neo4j.service: Consumed 3.299s CPU time.
liv@singularity:~$ sudo cypher-shell
You are using an unsupported version of the Java runtime. Please use Java(TM) 17 or Java(TM) 21.
username: neo4j
password:
Connected to Neo4j using Bolt protocol version 5.3 at neo4j://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j@neo4j>
This happens because Ubuntu "helpfully" installs the very latest version of java available, even if it's not the right dependency of the package being installed. This is probably why Java 19 got installed for you.
It would be best to install java 17 (or 21 if you prefer) and uninstall java 19. We don't test neo4j against java 19, so there's a chance something won't work, even if neo4j does successfully start up.
sudo apt install openjdk-17-jdk openjdk-17-jre sudo update-alternatives --config java liv@singularity:~$ sudo update-alternatives --config java There are 3 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ *0 /usr/lib/jvm/java-19-openjdk-amd64/bin/java 1911 auto mode 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode 2 /usr/lib/jvm/java-17-openjdk-amd64/bin/java 1711 manual mode 3 /usr/lib/jvm/java-19-openjdk-amd64/bin/java 1911 manual mode Press <enter> to keep the current choice[*], or type selection number: 2 update-alternatives: using /usr/lib/jvm/java-17-openjdk-amd64/bin/java to provide /usr/bin/java (java) in manual mode
After than cypher-shell and Neo4j server started without warnings.
liv@singularity:~$ sudo systemctl status neo4j.service
[sudo] password for liv:
Ć neo4j.service - Neo4j Graph Database
Loaded: loaded (/lib/systemd/system/neo4j.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-11-09 09:25:38 +07; 1 day 2h ago
Main PID: 443790 (code=exited, status=1/FAILURE)
CPU: 3.419s
Notice: journal has been rotated since unit was started, output may be incomplete.
I still have FAILURE status for neo4j.service, and i can connect to service?
liv@singularity:~$ cypher-shell
username: neo4j
password:
Connected to Neo4j using Bolt protocol version 5.3 at neo4j://localhost:7687 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j@neo4j>
Nov 10 11:46:55 singularity neo4j[740413]: 2023-11-10 04:46:55.805+0000 INFO Starting...
Nov 10 11:46:57 singularity neo4j[740413]: 2023-11-10 04:46:57.088+0000 INFO This instance is ServerId{b3a18ea2} (b3a18ea2-a71e-4233-a748-692c24c6eaea)
Nov 10 11:46:58 singularity neo4j[740413]: 2023-11-10 04:46:58.069+0000 INFO ======== Neo4j 5.13.0 ========
Nov 10 11:46:59 singularity neo4j[740413]: 2023-11-10 04:46:59.451+0000 INFO Bolt enabled on localhost:7687.
Nov 10 11:47:00 singularity neo4j[740413]: 2023-11-10 04:47:00.265+0000 INFO HTTP enabled on localhost:7474.
Nov 10 11:47:00 singularity neo4j[740413]: 2023-11-10 04:47:00.266+0000 INFO Remote interface available at http://localhost:7474/
Nov 10 11:47:00 singularity neo4j[740413]: 2023-11-10 04:47:00.269+0000 INFO id: 374703ABA4DDF840F4315A4C7AC462838DCC4D0D2B6EE3EE077B3B7248CA8F52
Nov 10 11:47:00 singularity neo4j[740413]: 2023-11-10 04:47:00.269+0000 INFO name: system
Nov 10 11:47:00 singularity neo4j[740413]: 2023-11-10 04:47:00.269+0000 INFO creationDate: 2023-11-06T03:51:13.375Z
Nov 10 11:47:00 singularity neo4j[740413]: 2023-11-10 04:47:00.270+0000 INFO Started.