Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

logstash with java10 get error : Unrecognized VM option 'UseParNewGC' [closed]

Tags:

logstash

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.

like image 616
kylekong Avatar asked Apr 03 '18 06:04

kylekong


3 Answers

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

like image 70
Andrea Avatar answered Nov 20 '22 13:11

Andrea


You probably have Java 10 (not proper version). You should install Java 8 (Ubuntu solution):

sudo apt install openjdk-8-jdk

It won't automatically change your default java compiler. Your should make it by your own. Change default java compiler:

sudo update-alternatives --config java

Type 0 or 1 or 2 ... option. Probably last entry. Now:

./logstash -f ../your-logstash-file.conf
like image 45
andrew Avatar answered Nov 20 '22 15:11

andrew


According to the install guide... it is supported.

https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

"Elasticsearch requires Java 8 or later. Use the official Oracle distribution or an open-source distribution such as OpenJDK."

like image 2
user617932 Avatar answered Nov 20 '22 13:11

user617932