# Apm agent failed to start on open JDK 11

**URL:** <https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702>\
**Category:** APM\
**Tags:** java\
**Created:** [September 2, 2019, 2:14pm UTC](https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702 "2019-09-02T14:14:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tchitch](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@tchitch](https://discuss.elastic.co/u/tchitch)\
**Post date:** [September 2, 2019, 2:14pm UTC](https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702/1 "2019-09-02T14:14:20Z")

</div>

**APM Server version** :  
7.3.1

**APM Agent language and version** :  
java 11 - elastic-apm-agent: 1.9.0

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
docker 7.3.1  
**Fresh install or upgraded from other version?**  
docker 7.3.1  
**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
Apm agent failed to start on open JDK 11

**Steps to reproduce** :

1. create a basic helloworld project
2. Launch this project using openJdk 11 and the apm agent 1.9.0:  
java  
-javaagent:agents/elastic-apm-agent-1.9.0.jar  
-Delastic.apm.server\_url=http://localhost:8200  
-Delastic.apm.service\_name=test  
-Delastic.apm.application\_packages=test  
-jar helloworld.jar

**Provide logs and/or server output (if relevant)**:

```
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2019-09-02 16:07:16.723 [apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2019-08-19T19:05:40Z", "build_sha": "ead4e8ba325a393bf1a83d0d0a4130114b5f778e", "version": "7.3.1"}
Failed to start agent
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at co.elastic.apm.agent.bci.AgentMain.init(AgentMain.java:85)
	at co.elastic.apm.agent.bci.AgentMain.premain(AgentMain.java:54)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
	at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.lang.NoClassDefFoundError: sun/misc/Unsafe
	at co.elastic.apm.agent.shaded.lmax.disruptor.util.Util$1.run(Util.java:103)
	at co.elastic.apm.agent.shaded.lmax.disruptor.util.Util$1.run(Util.java:100)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at co.elastic.apm.agent.shaded.lmax.disruptor.util.Util.<clinit>(Util.java:109)
	at co.elastic.apm.agent.shaded.lmax.disruptor.RingBufferFields.<clinit>(RingBuffer.java:34)
	at co.elastic.apm.agent.shaded.lmax.disruptor.dsl.Disruptor.<init>(Disruptor.java:137)
	at co.elastic.apm.agent.report.ApmServerReporter.<init>(ApmServerReporter.java:106)
	at co.elastic.apm.agent.report.ReporterFactory.createReporter(ReporterFactory.java:43)
	at co.elastic.apm.agent.impl.ElasticApmTracerBuilder.build(ElasticApmTracerBuilder.java:117)
	at co.elastic.apm.agent.bci.ElasticApmAgent.initialize(ElasticApmAgent.java:98)
	... 12 more
hello
```

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [September 2, 2019, 2:35pm UTC](https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702/2 "2019-09-02T14:35:17Z")

</div>

Hi,

Can you check if version 1.8.0 of the agent would work?

We are using the java agent 1.8.0 on the Amazon Corretto JDK 11.0.4 (on RedHat 6) and it works for us.

If this works for you someone has to find out why the the new version does not work.

Best regards  
Wolfram

---

<div class="post-metadata">

**Author:** ![tchitch](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@tchitch](https://discuss.elastic.co/u/tchitch)\
**Post date:** [September 2, 2019, 3:01pm UTC](https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702/3 "2019-09-02T15:01:34Z")

</div>

Hi,

same issue with the 1.8.0  
java -version gives me:

openjdk version "11.0.4" 2019-07-16  
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)  
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)

for the OS:

| Description: | Ubuntu 18.04.3 LTS |
| --- | --- |
| Release: | 18.04 |
| Codename: | bionic |

regards

---

<div class="post-metadata">

**Author:** ![Wolfram\_Haussig](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfram_haussig/32/70528_2.png) [@Wolfram\_Haussig](https://discuss.elastic.co/u/Wolfram_Haussig)\
**Post date:** [September 3, 2019, 4:29am UTC](https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702/4 "2019-09-03T04:29:35Z")

</div>

The only difference I can see here is that we still use APM Server 6.8 so maybe the connection logic for 6.x and 7.x are different? Maybe someone from the team can have a look at it?

---

<div class="post-metadata">

**Author:** ![tchitch](https://avatars.discourse-cdn.com/v4/letter/t/a87d85/32.png) [@tchitch](https://discuss.elastic.co/u/tchitch)\
**Post date:** [September 3, 2019, 6:46am UTC](https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702/5 "2019-09-03T06:46:15Z")

</div>

in fact I was doing my tests inside eclipse,  
I have redone my test using the command line and I am not facing anymore the issue.

regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 24, 2019, 2:46am UTC](https://discuss.elastic.co/t/apm-agent-failed-to-start-on-open-jdk-11/197702/6 "2019-09-24T02:46:24Z")

</div>

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