Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with java10 I get these error :Unrecognized VM option 'UseParNewGC' #9316

Closed
kxy000 opened this issue Apr 3, 2018 · 30 comments
Closed

with java10 I get these error :Unrecognized VM option 'UseParNewGC' #9316

kxy000 opened this issue Apr 3, 2018 · 30 comments
Labels
bug P3 Low Priority Bug

Comments

@kxy000
Copy link

kxy000 commented Apr 3, 2018

  • Version: logstash-6.2.3
  • Operating System: ubuntu 16.04 64
  • Config File (if you have sensitive info, please remove it): simple conf
  • Sample Data:
  • Steps to Reproduce:

1.download logstash-6.2.3.zip
2.unzip
3. java -version : 10
3.use this command : ./bin/logstash -f logstash.conf

get these error:

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

Please help

Thank you so much ~

==============================

not suport java 10 ~~~~ closed~

@andrewvc andrewvc added bug P3 Low Priority Bug labels Apr 9, 2018
@andrewvc andrewvc mentioned this issue Apr 10, 2018
3 tasks
@andrewvc
Copy link
Contributor

We're now tracking Java10 support here: #9345 . Thanks for opening the issue.

@kratos13
Copy link

kratos13 commented Jun 8, 2018

(+) OSX High Sierra 10.13.4 (17E202

java -version

java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

bin/logstash -f logstash.conf

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

@jamsheer-thottathil
Copy link

I am too getting the same issue

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

@jobinthepast
Copy link

I'm getting this one too on Sierra 10.13.3, downloaded ES 2.3.3 source and extracted. Got this error messages when trying to run elasticsearch

$ ./elasticsearch-2.3.3/bin/elasticsearch
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Any solutions please?

@jobinthepast
Copy link

My problem solved.

The version of java is not compatible. This one here works for me. ES got started properly.

Hope this could help somebody.

@AndyBoat
Copy link

I meet a same problem too; Any solutions?

➜  logstash-6.3.1 ./bin/logstash -e 'input { stdin {} } output {stdout {}}'
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
➜  logstash-6.3.1 java --version
java 10.0.1 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

@thulasipavankumar
Copy link

+1
I am also facing the same issue

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

My java versions is
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

@thalesac
Copy link

The only fix for now is use the openjdk-8-jre package.

@jsvd
Copy link
Member

jsvd commented Aug 29, 2018

logstash doesn't work with jdk 9+, please refer to #9345 on current limitations

@jsvd jsvd closed this as completed Aug 29, 2018
bhirsch70 added a commit to bhirsch70/ansible-elk that referenced this issue Oct 31, 2018
'with java10 I get these error :Unrecognized VM option 'UseParNewGC' #9316'
elastic/logstash#9316

- Added a workaround to problem in which the logstash systemd unit does not get
installed automatically.  See known issue:
'Missing systemd scripts in 6.2.4 #9403'
elastic/logstash#9403
@edperry
Copy link

edperry commented Oct 31, 2018

yah I just hit this issue too, hope we get a perm solution soon. While I have no problem installing JDK1.8 it would be nice to have it check the version before continuing if it is not yet supported.

#~/Downloads$ java --version
openjdk 10.0.2 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)
#~/Downloads$ ~/Downloads/logstash-6.4.2/bin/logstash-plugin prepare-offline-pack --output offline-pack-logstash-input-snmp.zip logstash-input-snmp --overwrite
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

@Leakkim84
Copy link

I think the problem can be fixed for Java versions 9+ by changing 2 lines of code in the jvm.options file in the config folder.
Remove or comment line: -XX:+UseParNewGC
Remove or comment line: -XX:+UseConcMarkSweepGC
Add this line instead: -XX:+UseG1GC
Apparently the previously used GC in Java 8 and older was deprecated in Java 9 and removed in Java 10.
The new suggested default GC is the G1 collector, which will be used after the aforementioned changes.
Can someone check if it works for someone else but me?

@ghost
Copy link

ghost commented Nov 16, 2018

@Leakkim84 I can confirm it at least gets logstash running when using java 10

@Seegras
Copy link

Seegras commented Nov 20, 2018

It probably would run weren't it for some stupid check in jruby:/jruby-ssl "unsupported Java version "10", defaulting to 1.7"

@jaredbrogan
Copy link

@Leakkim84 That fixed the same issue when using Java 11. Thanks!

@PS-StuartZahn
Copy link

PS-StuartZahn commented Dec 21, 2018

Seems to only work on Java 1.8 for now

Getting this error with OpenJDK 11, is OpenJDK supported?

D:\logstash\logstash-6.5.4\bin>logstash.bat
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

D:\logstash\logstash-6.5.4\bin>java --version
openjdk 11.0.1 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)


Getting the same error with JRE

D:\logstash\logstash-6.5.4\bin>echo %JAVA_HOME%
C:\Program Files\Java\jdk-11.0.1

D:\logstash\logstash-6.5.4\bin>java --version
java 11.0.1 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

D:\logstash\logstash-6.5.4\bin>setup.bat

D:\logstash\logstash-6.5.4\bin>logstash.bat -f mypipeline.conf
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

D:\logstash\logstash-6.5.4\bin>

@schwaz80
Copy link

schwaz80 commented Dec 24, 2018

I think the problem can be fixed for Java versions 9+ by changing 2 lines of code in the jvm.options file in the config folder.
Remove or comment line: -XX:+UseParNewGC
Remove or comment line: -XX:+UseConcMarkSweepGC
Add this line instead: -XX:+UseG1GC
Apparently the previously used GC in Java 8 and older was deprecated in Java 9 and removed in Java 10.
The new suggested default GC is the G1 collector, which will be used after the aforementioned changes.
Can someone check if it works for someone else but me?

Worked for me... err well, spoke to soon. Running into that jruby issue above.

@OSP123
Copy link

OSP123 commented Dec 31, 2018

@PS-StuartZahn Any luck? Running into the same issue with Java Open SDK 11.01

@kitmoovup
Copy link

Any update for that?

@yaauie
Copy link
Member

yaauie commented Jan 4, 2019

At this point, there is a tangle of dependencies that need to get resolved, and I am in the process of chasing that down.

  • the version of jruby we are pinned to doesn't work with JDK11, so we need to update that
  • the latest version of jruby, which does work with JDK11, requires an updated bundler, and our plugin managent currently relies pretty heavily on APIs that were changed in that version of bundler.

Additionally, some APIs within jruby have changed, so we are updating some development dependencies to ensure that tests pass.

Development is ongoing in the public jruby_9_2 branch, and I expect to have builds green there sometime next week.

After that, there will be some java deprecations to chase down, such as the garbage collector settings described above.

The goal is to have all of this together by the time the 7.0.0 beta drops in a few weeks, and then to work on backporting to the 6.x series.

@Sviatik
Copy link

Sviatik commented Jan 22, 2019

I think the problem can be fixed for Java versions 9+ by changing 2 lines of code in the jvm.options file in the config folder.
Remove or comment line: -XX:+UseParNewGC
Remove or comment line: -XX:+UseConcMarkSweepGC
Add this line instead: -XX:+UseG1GC
Apparently the previously used GC in Java 8 and older was deprecated in Java 9 and removed in Java 10.
The new suggested default GC is the G1 collector, which will be used after the aforementioned changes.
Can someone check if it works for someone else but me?

Worked for me as well.

@smitto
Copy link

smitto commented Jan 24, 2019

I've also been running into the unsupported Java version "10", defaulting to 1.7 issue. It seems some of this is being addressed here

@yaauie
Copy link
Member

yaauie commented Feb 5, 2019

Support for Java 11 has been merged, and is on track for upcoming releases:

branch pull-request next release
6.x #10382 v6.7.0
master #10279 v7.0.0-beta1

@oseikofi88
Copy link

oseikofi88 commented Mar 30, 2019

-XX:+UseParNewGC

I think the problem can be fixed for Java versions 9+ by changing 2 lines of code in the jvm.options file in the config folder.
Remove or comment line: -XX:+UseParNewGC
Remove or comment line: -XX:+UseConcMarkSweepGC
Add this line instead: -XX:+UseG1GC
Apparently the previously used GC in Java 8 and older was deprecated in Java 9 and removed in Java 10.
The new suggested default GC is the G1 collector, which will be used after the aforementioned changes.
Can someone check if it works for someone else but me?

Worked for me as well.

Where is the jvm.options file located?
I am running ubuntu 18.04

@scottdharvey
Copy link

Running JRE8u201/202 no longer works for me. There is an April 2019 update that affects corporate customers(according to the installer splash screen), and I have had to use the solution provided by @Leakkim84 .

I think the problem can be fixed for Java versions 9+ by changing 2 lines of code in the jvm.options file in the config folder.Remove or comment line: -XX:+UseParNewGCRemove or comment line: -XX:+UseConcMarkSweepGCAdd this line instead: -XX:+UseG1GCApparently the previously used GC in Java 8 and older was deprecated in Java 9 and removed in Java 10.The new suggested default GC is the G1 collector, which will be used after the aforementioned changes.Can someone check if it works for someone else but me?

Only the first two lines were present in my config, but removing UseParNewGCRemove & UseConcMarkSweepGCAdd resolved this issue for me.

@sahil-rajput
Copy link

I got the same error.
To resolve it

Run sudo nano /usr/share/elasticsearch/bin/elasticsearch.in.sh and comment out that VM arg

#ES_GC_OPTS="$ES_GC_OPTS -XX:+UseParNewGC"

@areoid
Copy link

areoid commented Apr 30, 2020

I got the same error.
To resolve it

Run sudo nano /usr/share/elasticsearch/bin/elasticsearch.in.sh and comment out that VM arg

#ES_GC_OPTS="$ES_GC_OPTS -XX:+UseParNewGC"

amazing, it works

@ahmadSaeedGoda
Copy link

I got the same error.
To resolve it

Run sudo nano /usr/share/elasticsearch/bin/elasticsearch.in.sh and comment out that VM arg

#ES_GC_OPTS="$ES_GC_OPTS -XX:+UseParNewGC"

Thank you very much.
worked after too much struggle!

@svilambi
Copy link

it failed for on JDK 11 but it worked for me on JDK 1.8 thanks.

@shubham-jain512
Copy link

This is resolve by running below command:

set JAVA_PARAMETERS=-XX:+UseG1GC

@SaqlainHussainShah
Copy link

SaqlainHussainShah commented Mar 30, 2022

I have tried with Java 11, 13 and 17. I am installing logstash version 5.2.0 on ubuntu 20 and getting
Using provided startup.options file: /etc/logstash/startup.options Unrecognized VM option 'UseParNewGC' 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P3 Low Priority Bug
Projects
None yet
Development

No branches or pull requests