# How to run tests with a JVM flag which points to a dependency jar?

**URL:** <https://discuss.circleci.com/t/how-to-run-tests-with-a-jvm-flag-which-points-to-a-dependency-jar/29434>\
**Category:** Build Environment\
**Tags:** sbt, java\
**Created:** [April 1, 2019, 5:26pm UTC](https://discuss.circleci.com/t/how-to-run-tests-with-a-jvm-flag-which-points-to-a-dependency-jar/29434 "2019-04-01T17:26:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathaniel-may](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nathaniel-may/32/21846_2.png) [@nathaniel-may](https://discuss.circleci.com/u/nathaniel-may)\
**Post date:** [April 1, 2019, 5:26pm UTC](https://discuss.circleci.com/t/how-to-run-tests-with-a-jvm-flag-which-points-to-a-dependency-jar/29434/1 "2019-04-01T17:26:02Z")

</div>

The scala package I’m writing depends on [jamm](https://github.com/jbellis/jamm) which requires a flag like the following to be set on the JVM:

```auto
-javaagent:"~/.ivy2/cache/com.github.jbellis/jamm/jars/jamm-0.3.3.jar"

```

I tried setting the `JAVA_OPTS` environment variable through the CircleCI interface but I get the following error during the `sbt:compile` phase:

```auto
Error opening zip file or JAR manifest missing : "~/.ivy2/cache/com.github.jbellis/jamm/jars/jamm-0.3.3.jar"

```

The good thing is that the flag is being read, but I’m not sure how to figure out what place I should be pointing it to. I’m restoring my `~/.ivy2` directory from cache, and my build file has compiled on previous runs so it should be in there.

---

<div class="post-metadata">

**Author:** ![nathaniel-may](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nathaniel-may/32/21846_2.png) [@nathaniel-may](https://discuss.circleci.com/u/nathaniel-may)\
**Post date:** [April 11, 2019, 10:02pm UTC](https://discuss.circleci.com/t/how-to-run-tests-with-a-jvm-flag-which-points-to-a-dependency-jar/29434/2 "2019-04-11T22:02:37Z")

</div>

For anyone who finds this, I just needed to change the environment variable to

```auto
-javaagent:/home/circleci/.ivy2/cache/com.github.jbellis/jamm/jars/jamm-0.3.3.jar

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [April 21, 2019, 10:02pm UTC](https://discuss.circleci.com/t/how-to-run-tests-with-a-jvm-flag-which-points-to-a-dependency-jar/29434/3 "2019-04-21T22:02:40Z")

</div>

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