When installing Logstash on Kali, I encountered the following problem:
# dpkg -i logstash-7.2.0.deb
Selecting previously unselected package logstash.
(Reading database ... 435725 files and directories currently installed.)
Preparing to unpack logstash-7.2.0.deb ...
Unpacking logstash (1:7.2.0-1) ...
Setting up logstash (1:7.2.0-1) ...
Using provided startup.options file: /etc/logstash/startup.options
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unable to install system startup script for Logstash.
chmod: cannot access '/etc/default/logstash': No such file or directory
dpkg: error processing package logstash (--install):
installed logstash package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
logstash
The message Error: Could not create the Java Virtual Machine.
notified me that there was a problem related to the JVM.
I already installed JDK version 11
, which is compatible with Logstash version 7.2.0
being installed.
However, it was necessary to switch to the JDK version 11
.
The current JDK version being used on the system is 17
:
# java -version
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-Debian-1)
OpenJDK 64-Bit Server VM (build 17.0.10+7-Debian-1, mixed mode, sharing)
Configure the system to use JVM version 10
:
# sudo update-java-alternatives --set /usr/lib/jvm/java-1.11.0-openjdk-amd64
# java -version
openjdk version "11.0.20-ea" 2023-07-18
OpenJDK Runtime Environment (build 11.0.20-ea+7-post-Debian-1)
OpenJDK 64-Bit Server VM (build 11.0.20-ea+7-post-Debian-1, mixed mode, sharing)
FYI, in order to enumerate installed JVM versions available, you can type the following command:
# update-java-alternatives --list
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64
https://askubuntu.com/questions/740757/switch-between-multiple-java-versions
https://www.elastic.co/kr/support/matrix#matrix_jvm&#enterprise-search-and-jvm