Switch to Java17 on Linux

From LogicalDOC Community Wiki
Revision as of 09:33, 7 May 2024 by Blucecio (talk | contribs)
Jump to navigationJump to search

Reconfigure LogicalDOC to use Java 17 on Linux

Starting from version 8.9.1 LogicalDOC does not work with Java 11 anymore so you have to install Java17. Please read first how to install the right Java to use with LogicalDOC.

It is important to install Java 17 and not Java 18 or Java 19, because Java 17 is an LTS (Long Term Support) version and therefore support and updates will be available for a long time.

Given <LDOC_HOME> the installation path of LogicalDOC (by default it is /LogicalDOC), please proceed as follows:

1. Install Java 17 from Oracle or OpenJDK17

Hint for Ubuntu:

$ apt install -y openjdk-17-jdk

Hint for CentOS and RedHat:

$ wget https://download.java.net/openjdk/jdk17/ri/openjdk-17+35_linux-x64_bin.tar.gz
$ tar xvf openjdk*
$ sudo mv jdk-17 /usr/java/
$ sudo ln -sfn /usr/java/jdk-17 /usr/java/latest
$ sudo ln -sfn /usr/java/jdk-17 /usr/java/default
$ sudo ln -sfn /usr/java/latest/bin/java /usr/bin/java

2. With VI, or any other text editor, open the file <LDOC_HOME>/bin/logicaldoc.sh. Inside that file, locate the variable JAVA_HOME and make sure it points to the Java17 installation folder:
Probable path in Ubuntu:

export JAVA_HOME=/usr

Probable path in CentOS and RedHat:

export JAVA_HOME=/usr/java/latest

3. Iterate the point 2 for this list of additional files:

  • <LDOC_HOME>/bin/update.sh
  • <LDOC_HOME>/bin/patch.sh
  • <LDOC_HOME>/bin/restart.sh
  • <LDOC_HOME>/bin/reset-passwd.sh

4. Restart LogicalDOC