2

I am very new to elasticsearch. I found some simple java code for using elasticsearch:

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

// on startup

Node node = nodeBuilder().node();
Client client = node.client();

// on shutdown

node.close();

I am getting the following error:

package org.elasticsearch.node doesn't exist

Later, I found that I have put some information in pom.xml. What is that? How to make this simple program run?

1 Answer 1

5

Do you know what Maven is?

I mean that if you are using Maven, then you need to add elasticsearch-VERSION.jar as a dependency in your pom.xml.

If not, then you need to add elasticsearch jar in your project classpath and some other libs such as (it depends of elasticsearch version you are using):

  • antlr-runtime-3.5.jar
  • asm-4.1.jar
  • asm-commons-4.1.jar
  • jna-3.3.0.jar
  • jts-1.12.jar
  • log4j-1.2.17.jar
  • lucene-analyzers-common-4.6.0.jar
  • lucene-codecs-4.6.0.jar
  • lucene-core-4.6.0.jar
  • lucene-expressions-4.6.0.jar
  • lucene-grouping-4.6.0.jar
  • lucene-highlighter-4.6.0.jar
  • lucene-join-4.6.0.jar
  • lucene-memory-4.6.0.jar
  • lucene-misc-4.6.0.jar
  • lucene-queries-4.6.0.jar
  • lucene-queryparser-4.6.0.jar
  • lucene-sandbox-4.6.0.jar
  • lucene-spatial-4.6.0.jar
  • lucene-suggest-4.6.0.jar
  • spatial4j-0.3.jar

I'd recommend to use Maven because it's much easier to deal with dependencies.

Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.