logstash with java10 get error : Unrecognized VM option 'UseParNewGC'

kylekong picture kylekong · Apr 3, 2018 · Viewed 16.6k times · Source

I'm running logstash with Java 10 as follows:

./logstash -f std_std.conf 

but I get this error:

Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Thank you so much in advance.


Sorry. I've found out Java 10 is not supported. Closing.

Answer

Andrea picture Andrea · May 12, 2018

As @kylekong said, java 10 is not supported. You could install java 8 instead. Using Ubuntu you should do something like this:

sudo -i
apt-get update
apt-get install openjdk-8-jre-headless -y
apt-get install openjdk-8-jdk-headless -y
java -version
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
apt-get install apt-transport-https
apt-get update && apt-get install logstash
exit

Then you can start Logstash with:

sudo systemctl start logstash

Reference: https://www.elastic.co/guide/en/logstash/current/installing-logstash.html