Elasticsearch 6.2.4 not working when using OpenJDK 9

Hi,
I am Trying to Run Elasticsearch 6.2.4 on OpenJdk 9,
But when ever i try to start elasticsearch, i get the below error,

May 09 06:37:03 ip-172-31-48-228 systemd[1]: Started Elasticsearch.
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: [2018-05-09T06:37:09,837][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [universal-spot-939345] fatal error in thread [main], exiting
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: java.lang.NoSuchMethodError: java.lang.ProcessHandle.pid()J
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.monitor.jvm.JvmPid.getPid(JvmPid.java:27) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.monitor.jvm.JvmInfo.(JvmInfo.java:153) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.bootstrap.Bootstrap.initializeProbes(Bootstrap.java:160) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:179) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.4.jar:6.2.4]
May 09 06:37:09 ip-172-31-48-228 elasticsearch[11621]: at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.4.jar:6.2.4]

What OS, how did you install it?

I am Using Ubuntu 16.04,
and installed the ES using Deb package (https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.deb).

Can you check the Elasticsearch logs and post those?

Below are the logs

[2018-05-09T07:21:57,896][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [universal-spot-939345] fatal error in thread [main], exiting
java.lang.NoSuchMethodError: java.lang.ProcessHandle.pid()J
	at org.elasticsearch.monitor.jvm.JvmPid.getPid(JvmPid.java:27) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.monitor.jvm.JvmInfo.<clinit>(JvmInfo.java:153) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Bootstrap.initializeProbes(Bootstrap.java:160) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:179) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.4.jar:6.2.4]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.4.jar:6.2.4]

Same is repeated everytime i try to start ES

Thanks

Can you post the full output of running

java -version

Thanks.

openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)

I have Installed openjdk-9-jre.

thanks

That looks like a pre-release, internal build of JDK9
Java 9 was officially released in September 2017, and it looks like you have a build from April 2016.

You'll need to get a more recent, supported release of Java 9 (or Java 8).

Thanks,
Initially i installed jdk 9 using apt install openjdk-9-jdk, which was installing the above version.
after i manually installed jdk 9+181, I am able to run ES.

Thanks for the Help :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.