# Build from source but NoClassDefFoundError:ExtendedPluginsClassLoader

**URL:** <https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912>\
**Category:** Elasticsearch\
**Created:** [May 23, 2018, 2:01am UTC](https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912 "2018-05-23T02:01:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![golmic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/golmic/32/31494_2.png) [@golmic](https://discuss.elastic.co/u/golmic)\
**Post date:** [May 23, 2018, 2:01am UTC](https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912/1 "2018-05-23T02:01:38Z")

</div>

**Elasticsearch version** (`bin/elasticsearch --version`):

Version: 6.2.4

**Plugins installed** : []

None

**JVM version** (`java -version`):

java version "10.0.1" 2018-04-17  
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)  
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

**OS version** (`uname -a` if on a Unix-like system):

MacBook-Pro.local 17.5.0 Darwin Kernel Version 17.5.0

**Description of the problem including expected versus actual behavior** :

I want to build ES and debug.ES6.2.4

**Steps to reproduce** :

1. download `https://github.com/elastic/elasticsearch/archive/v6.2.4.zip` and unzip
2. `cd` && `gradle idea`
3. `brew install elasticsearch`
4. [https://www.elastic.co/downloads/elasticsearch](https://www.elastic.co/downloads/elasticsearch) and download  
`https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.zip`

copy elasticsearch-6.2.4’s modules and plugins to `/usr/local/var/elasticsearch`

in idea,

```auto
-Des.path.conf=/usr/local/etc/elasticsearch/
-Des.path.home=/usr/local/var/elasticsearch/
-Dlog4j2.disable.jmx=true

```

run `elasticsearch-6.2.4/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java`

**Provide logs (if relevant)**:

```auto
[2018-05-22T13:52:44,399][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [] fatal error in thread [main], exiting
java.lang.NoClassDefFoundError: org/elasticsearch/plugins/ExtendedPluginsClassLoader
	at org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:494) ~[main/:?]
	at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:422) ~[main/:?]
	at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:146) ~[main/:?]
	at org.elasticsearch.node.Node.<init>(Node.java:303) ~[main/:?]
	at org.elasticsearch.node.Node.<init>(Node.java:246) ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:213) ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:213) ~[main/:?]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[main/:?]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[main/:?]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[main/:?]
	at org.elasticsearch.cli.Command.main(Command.java:90) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[main/:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[main/:?]
Caused by: java.lang.ClassNotFoundException: org.elasticsearch.plugins.ExtendedPluginsClassLoader
	at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582) ~[?:?]
	at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) ~[?:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:499) ~[?:?]
	... 15 more

```

---

<div class="post-metadata">

**Author:** ![golmic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/golmic/32/31494_2.png) [@golmic](https://discuss.elastic.co/u/golmic)\
**Post date:** [May 24, 2018, 4:57am UTC](https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912/2 "2018-05-24T04:57:24Z")

</div>

please help me

---

<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:** [May 26, 2018, 1:54am UTC](https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912/3 "2018-05-26T01:54:06Z")

</div>

> please help me

Please be patient.

You're steps to reproduce seem to be different ways of installing elasticsearch, but not actually a list of steps to run.

> copy elasticsearch-6.2.4’s modules and plugins to /usr/local/var/elasticsearch

You should not modify the installation of elasticsearch. That can produce all kinds of weird errors.

> run elasticsearch-6.2.4/server/src/main/java/org/elasticsearch/bootstrap/Elasticsearch.java

Are you trying to run the Elasticsearch class directly, not with `bin/elasticsearch`? If so, that is unsupported. Elasticsearch requires a very particular java setup, and the bin script sets up this environment (including classpath) as Elasticsearch expects.

Please give more detailed reproduction instructions.

---

<div class="post-metadata">

**Author:** ![golmic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/golmic/32/31494_2.png) [@golmic](https://discuss.elastic.co/u/golmic)\
**Post date:** [May 26, 2018, 2:47am UTC](https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912/4 "2018-05-26T02:47:09Z")

</div>

hi! Thanks for reply.

What I want to do is debug the Elasticsearch, which means I want to follow the step to find out what Elasticsearch does when I index a document or search.  
I use IntelliJ IDEA help me to do this.

> Are you trying to run the Elasticsearch class directly, not with bin/elasticsearch

I don't know what should I do after runing `gradle idea`.

How to run the Elasticsearch class directly ?

Thank you very much.

---

<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:** [May 30, 2018, 7:58am UTC](https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912/5 "2018-05-30T07:58:20Z")

</div>

For the stated purpose, it is best to checkout elasticsearch from GitHub. Once you have done this,  
`./gradlew idea` is only initialized the IntelliJ project. You then need to follow the instructions in the [CONTRIBUTING guide](https://github.com/elastic/elasticsearch/blob/master/CONTRIBUTING.md) for importing the project into IntelliJ. You can then add a "Remote" debug configuration in IntelliJ, [run elasticsearch from source](https://github.com/elastic/elasticsearch/blob/master/TESTING.asciidoc#launching-and-debugging-from-an-ide) and run the debug action in IntelliJ.  
.

---

<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:** [June 27, 2018, 7:58am UTC](https://discuss.elastic.co/t/build-from-source-but-noclassdeffounderror-extendedpluginsclassloader/132912/6 "2018-06-27T07:58:22Z")

</div>

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