16

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.

BaCaRoZzo
  • 7,502
  • 6
  • 51
  • 82
kylekong
  • 199
  • 1
  • 1
  • 5

4 Answers4

6

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

Andrea
  • 4,262
  • 4
  • 37
  • 56
5

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
andrew
  • 3,083
  • 4
  • 24
  • 29
2

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."

user617932
  • 33
  • 5
0

In the Elastic documentation for installing Logstash, it was mentioned that Logstash requires Java 8.

Logstash requires Java 8. Java 9 is not supported. Use the official Oracle distribution or an open-source distribution such as OpenJDK.

You can download Java 8 and try again. Hope it helps.

$ java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

$ ./bin/logstash -f logstash.conf 
Sending Logstash's logs to ...
Dorjee Dhondup
  • 549
  • 6
  • 15