# Beginner Question - ElasticSearch and Java API

**URL:** <https://discuss.elastic.co/t/beginner-question-elasticsearch-and-java-api/13127>\
**Category:** Elasticsearch\
**Created:** [August 8, 2013, 12:22pm UTC](https://discuss.elastic.co/t/beginner-question-elasticsearch-and-java-api/13127 "2013-08-08T12:22:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atelophobia](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Atelophobia](https://discuss.elastic.co/u/Atelophobia)\
**Post date:** [August 8, 2013, 12:22pm UTC](https://discuss.elastic.co/t/beginner-question-elasticsearch-and-java-api/13127/1 "2013-08-08T12:22:23Z")

</div>

Hi!

I'm totally new to elasticsearch and I have troubles with elasticSearch + Java.

System:  
Windows 7 (VirtualBox)  
Eclipse JavaEE (Kepler)  
JDK7  
elasticsearch-0.90.3

Here is what I tried:

Started two nodes (cmd): .../elasticsearch.bat  
checked by browser ([http://127.0.0.1:9200](http://127.0.0.1:9200)) --\> everything seems fine.  
checked by cmd (curl -XGET [http://127.0.0.1:9200/\_cluster/health?pretty](http://127.0.0.1:9200/_cluster/health?pretty)) --\> ok!

Then I created a new Java Project:  
(added "elasticsearch-0.90.3.jar" and "lucene-core-4.4.0.jar" in the build path)

import org.elasticsearch.node.Node;  
import static org.elasticsearch.node.NodeBuilder.\*;

public class test {  
public static void main(String[] args) {  
Node node = nodeBuilder().clusterName("elasticsearch").node();  
node.close();  
}  
}

And the result is:

Aug 08, 2013 1:44:46 PM org.elasticsearch.node INFO: [Crown] version[0.90.3], pid[2724], build[5c38d60/2013-08-06T13:18:31Z] Aug 08, 2013 1:44:46 PM org.elasticsearch.node INFO: [Crown] initializing ... Aug 08, 2013 1:44:46 PM org.elasticsearch.plugins INFO: [Crown] loaded [], sites [] Exception in thread "main" org.elasticsearch.common.collect.ComputationException: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer at org.elasticsearch.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:887) at org.elasticsearch.common.inject.internal.FailableCache.get(FailableCache.java:49) at org.elasticsearch.common.inject.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50) at org.elasticsearch.common.inject.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:50) at org.elasticsearch.common.inject.InjectorImpl.initializeBinding(InjectorImpl.java:372) at org.elasticsearch.common.inject.BindingProcessor$1$1.run(BindingProcessor.java:148) at org.elasticsearch.common.inject.BindingProcessor.initializeBindings(BindingProcessor.java:204) at org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:119) at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:102) at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93) at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70) at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:59) at org.elasticsearch.node.internal.InternalNode.(InternalNode.java:172) at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159) at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166) at test.test.main(test.java:8) Caused by: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413) at java.lang.Class.getDeclaredConstructors(Class.java:1855) at org.elasticsearch.common.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:177) at org.elasticsearch.common.inject.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:59) at org.elasticsearch.common.inject.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29) at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37) at org.elasticsearch.common.inject.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33) at org.elasticsearch.common.inject.internal.FailableCache$1.apply(FailableCache.java:38) at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:356) at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:182) at org.elasticsearch.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:151) at org.elasticsearch.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:67) at org.elasticsearch.common.collect.MapMaker$ComputingMapAdapter.get(MapMaker.java:883) ... 15 more Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.standard.StandardAnalyzer at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 29 more

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [August 12, 2013, 7:04pm UTC](https://discuss.elastic.co/t/beginner-question-elasticsearch-and-java-api/13127/2 "2013-08-12T19:04:18Z")

</div>

The result is not showing up, and without it, we cannot help. 🙂

The elasticsearch jar should contain all the relevant Lucene class, so  
there is no need to use the Lucene jar.

--  
Ivan

On Thu, Aug 8, 2013 at 5:22 AM, Atelophobia [new-account@gmx.net](mailto:new-account@gmx.net) wrote:

> Hi!
> 
> I'm totally new to elasticsearch and I have troubles with elasticSearch +  
> Java.
> 
> System:  
> Windows 7 (VirtualBox)  
> Eclipse JavaEE (Kepler)  
> JDK7  
> elasticsearch-0.90.3
> 
> Here is what I tried:
> 
> Started two nodes (cmd): .../elasticsearch.bat  
> checked by browser ([http://127.0.0.1:9200](http://127.0.0.1:9200)) --\> everything seems fine.  
> checked by cmd (curl -XGET [http://127.0.0.1:9200/\_cluster/health?pretty](http://127.0.0.1:9200/_cluster/health?pretty))  
> --\> ok!
> 
> Then I created a new Java Project:  
> (added "elasticsearch-0.90.3.jar" and "lucene-core-4.4.0.jar" in the build  
> path)
> 
> And the result is:
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/Beginner-Question-ElasticSearch-and-Java-API-tp4039323.html](http://elasticsearch-users.115913.n3.nabble.com/Beginner-Question-ElasticSearch-and-Java-API-tp4039323.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:21am UTC](https://discuss.elastic.co/t/beginner-question-elasticsearch-and-java-api/13127/3 "2017-07-06T02:21:29Z")

</div>


