# Error opening zip file or JAR manifest missing : elastic-apm-agent-1.12.0.jar

**URL:** <https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991>\
**Category:** APM\
**Tags:** java\
**Created:** [April 1, 2021, 7:23am UTC](https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991 "2021-04-01T07:23:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [April 1, 2021, 7:23am UTC](https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991/1 "2021-04-01T07:23:57Z")

</div>

I am getting an error trying to run the following command in linux to run the APM application agent:  
sudo java -javaagent:elastic-apm-agent-1.12.0.jar  
The error is as follows:  
Error opening zip file or JAR manifest missing : elastic-apm-agent-1.12.0.jar  
Error occurred during initialization of VM  
agent library failed to init: instrument

I have given all permissiions to the folder/file  
-rwxrwxrwx. 1 root root 134 Apr 1 17:28 elastic-apm-agent-1.12.0.jar

Any clues how do I resolve?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [April 1, 2021, 9:46am UTC](https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991/2 "2021-04-01T09:46:12Z")

</div>

> [@Stud21](#):
>
> sudo java -javaagent:elastic-apm-agent-1.12.0.jar

Is this the entire command line?  
`elastic-apm-agent.jar` is not an executable Java app, it is a jar added to the command line when running your Java app. `apm-agent-attach-standalone.jar` is an executable Java that may be used to remotely attach to another JVM.  
See [setup instructions](https://www.elastic.co/guide/en/apm/agent/java/current/setup.html) for details.

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [April 2, 2021, 11:15am UTC](https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991/3 "2021-04-02T11:15:15Z")

</div>

Below is the entire command line:  
sudo java -javaagent:elastic-apm-agent-1.12.0.jar   
-Delastic.apm.service\_name=petclinic-java   
-Delastic.apm.server\_urls=https://localhost:8200   
-Delastic.apm.secret\_token=   
-Delastic.apm.application\_packages=co.elastic.apm.petclient   
-jar spring-petclinic-2.4.2.jar

However, the error happens at 1st line as stated previously.

Tried as suggested by you from the below link with no success:

> **[Automatic setup with apm-agent-attach-standalone.jar | APM Java Agent...](https://www.elastic.co/guide/en/apm/agent/java/current/setup-attach-cli.html)**

I am a novice at Java

---

<div class="post-metadata">

**Author:** ![Stud21](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stud21](https://discuss.elastic.co/u/Stud21)\
**Post date:** [April 2, 2021, 1:21pm UTC](https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991/4 "2021-04-02T13:21:32Z")

</div>

Not sure what happened, but it seems to be working now.

I re-downloaded the file from the URL below and it seems to be fine now:  
wget [https://search.maven.org/remotecontent?filepath=co/elastic/apm/elastic-apm-agent/1.22.0/elastic-apm-agent-1.22.0.jar](https://search.maven.org/remotecontent?filepath=co/elastic/apm/elastic-apm-agent/1.22.0/elastic-apm-agent-1.22.0.jar)

Thanks

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [April 4, 2021, 1:20pm UTC](https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991/5 "2021-04-04T13:20:57Z")

</div>

👍  
Glad to hear!

---

<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:** [May 2, 2021, 1:21pm UTC](https://discuss.elastic.co/t/error-opening-zip-file-or-jar-manifest-missing-elastic-apm-agent-1-12-0-jar/268991/6 "2021-05-02T13:21:46Z")

</div>

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