# Integration test java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.test.ESTestCase

**URL:** <https://discuss.elastic.co/t/integration-test-java-lang-noclassdeffounderror-could-not-initialize-class-org-elasticsearch-test-estestcase/146887>\
**Category:** Elasticsearch\
**Created:** [August 31, 2018, 3:29pm UTC](https://discuss.elastic.co/t/integration-test-java-lang-noclassdeffounderror-could-not-initialize-class-org-elasticsearch-test-estestcase/146887 "2018-08-31T15:29:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuniersoad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuniersoad/32/33211_2.png) [@yuniersoad](https://discuss.elastic.co/u/yuniersoad)\
**Post date:** [August 31, 2018, 3:29pm UTC](https://discuss.elastic.co/t/integration-test-java-lang-noclassdeffounderror-could-not-initialize-class-org-elasticsearch-test-estestcase/146887/1 "2018-08-31T15:29:05Z")

</div>

I'm a bit confused since both jars "in conflict" belong to the sdk, full debug message is:

java.lang.RuntimeException: found jar hell in test classpath

```
	at org.elasticsearch.bootstrap.BootstrapForTesting.<clinit>(BootstrapForTesting.java:92)
	at org.elasticsearch.test.ESTestCase.<clinit>(ESTestCase.java:190)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.carrotsearch.randomizedtesting.RandomizedRunner$1.run(RandomizedRunner.java:562)
Caused by: java.lang.IllegalStateException: jar hell!
class: jdk.packager.services.UserJvmOptionsService
jar1: /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/ant-javafx.jar
jar2: /Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/lib/packager.jar
```

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [September 7, 2018, 9:50pm UTC](https://discuss.elastic.co/t/integration-test-java-lang-noclassdeffounderror-could-not-initialize-class-org-elasticsearch-test-estestcase/146887/2 "2018-09-07T21:50:12Z")

</div>

The jdk unfortunately has jar hell with itself. All the jars in lib are not meant to be used together. See the last note in this paragraph about IntelliJ setup in the[contributing docs](https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md#configuring-ides-and-running-tests):

> You may also need to [remove `ant-javafx.jar` from your classpath](https://github.com/elastic/elasticsearch/issues/14348) if that is reported as a source of jar hell.

---

<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:** [October 5, 2018, 9:50pm UTC](https://discuss.elastic.co/t/integration-test-java-lang-noclassdeffounderror-could-not-initialize-class-org-elasticsearch-test-estestcase/146887/3 "2018-10-05T21:50:19Z")

</div>

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