Running binary of elasticsearch source code after building

Hi,

I made very few changes in elasticsearch source code and I would like
to run a binary(./elasticsearch -f) of it by command line in
linux(ubuntu) after building it in intellij IDE.

getting error like this:
Exception in thread "main" java.lang.NoClassDefFoundError: org/
elasticsearch/bootstrap/ElasticSearch
Caused by: java.lang.ClassNotFoundException:
org.elasticsearch.bootstrap.ElasticSearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class:
org.elasticsearch.bootstrap.ElasticSearch. Program will exit.

Please give me the solution.

Thanks,
Kalyan

The simplest way to do it is by running elasticsearch directly from
IntelliJ. Create new run configuration by clicking Run->Edit
Configurations->"+"->Application.
Select org.elasticsearch.bootstrap.Bootstrap as a main class and paste the
following VM option:

-Des.foreground=yes

Alternatively, you can run it from command line using the following command
in the elasticsearch root directory:

$ ES_CLASSPATH="target/classes:target/lib/*" bin/elasticsearch -f

You just need to make sure that all dependencies are assembled in the
target/lib directory by running

$ mvn prepare-package -DskipTests

On Monday, April 2, 2012 9:17:33 AM UTC-4, BARNEY wrote:

Hi,

I made very few changes in elasticsearch source code and I would like
to run a binary(./elasticsearch -f) of it by command line in
linux(ubuntu) after building it in intellij IDE.

getting error like this:
Exception in thread "main" java.lang.NoClassDefFoundError: org/
elasticsearch/bootstrap/Elasticsearch
Caused by: java.lang.ClassNotFoundException:
org.elasticsearch.bootstrap.Elasticsearch
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class:
org.elasticsearch.bootstrap.Elasticsearch. Program will exit.

Please give me the solution.

Thanks,
Kalyan

It is running fine in IntelliJ before I created new run configuration by
clicking Run->Edit Configurations->"+"->Application.
Select org.elasticsearch.bootstrap.Bootstrap as a main class and paste the
following VM option:

-Des.foreground=yes

but after doing as u said its giving message like below and not running:::

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in
[jar:file:/home/avinash/.gradle/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[jar:file:/home/avinash/.gradle/cache/org.apache.tika/tika-app/bundles/tika-app-0.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[jar:file:/home/avinash/esearch/elasticsearchsource/git-elasticsearch/elasticsearch/plugins/mapper-attachments/tika-app-0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See SLF4J Error Codes for an
explanation.

Still I am not able to run it from command line.

On Mon, Apr 2, 2012 at 7:39 PM, Igor Motov imotov@gmail.com wrote:

The simplest way to do it is by running elasticsearch directly from
IntelliJ. Create new run configuration by clicking Run->Edit
Configurations->"+"->Application.
Select org.elasticsearch.bootstrap.Bootstrap as a main class and paste the
following VM option:

-Des.foreground=yes

Alternatively, you can run it from command line using the following
command in the elasticsearch root directory:

$ ES_CLASSPATH="target/classes:target/lib/*" bin/elasticsearch -f

You just need to make sure that all dependencies are assembled in the
target/lib directory by running

$ mvn prepare-package -DskipTests

On Monday, April 2, 2012 9:17:33 AM UTC-4, BARNEY wrote:

Hi,

I made very few changes in elasticsearch source code and I would like
to run a binary(./elasticsearch -f) of it by command line in
linux(ubuntu) after building it in intellij IDE.

getting error like this:
Exception in thread "main" java.lang.**NoClassDefFoundError: org/
elasticsearch/bootstrap/**Elasticsearch
Caused by: java.lang.**ClassNotFoundException:
org.elasticsearch.bootstrap.**Elasticsearch
at java.net.URLClassLoader$1.run(**URLClassLoader.java:217)
at java.security.**AccessController.doPrivileged(**Native
Method)
at java.net.URLClassLoader.**findClass(URLClassLoader.java:**205)

    at java.lang.ClassLoader.**loadClass(ClassLoader.java:**321)
    at sun.misc.Launcher$**AppClassLoader.loadClass(**Launcher.java:294)

    at java.lang.ClassLoader.**loadClass(ClassLoader.java:**266)

Could not find the main class:
org.elasticsearch.bootstrap.**Elasticsearch. Program will exit.

Please give me the solution.

Thanks,
Kalyan

I found the way.I created jar from it and put it in lib directory of
elasticsearch(any version).

On Tue, Apr 3, 2012 at 10:24 AM, kalyan chowdary kalyanc007@gmail.comwrote:

It is running fine in IntelliJ before I created new run configuration by
clicking Run->Edit Configurations->"+"->Application.
Select org.elasticsearch.bootstrap.Bootstrap as a main class and paste the
following VM option:

-Des.foreground=yes

but after doing as u said its giving message like below and not running:::

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in
[jar:file:/home/avinash/.gradle/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.5.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[jar:file:/home/avinash/.gradle/cache/org.apache.tika/tika-app/bundles/tika-app-0.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[jar:file:/home/avinash/esearch/elasticsearchsource/git-elasticsearch/elasticsearch/plugins/mapper-attachments/tika-app-0.9.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See SLF4J Error Codes for an
explanation.

Still I am not able to run it from command line.

On Mon, Apr 2, 2012 at 7:39 PM, Igor Motov imotov@gmail.com wrote:

The simplest way to do it is by running elasticsearch directly from
IntelliJ. Create new run configuration by clicking Run->Edit
Configurations->"+"->Application.
Select org.elasticsearch.bootstrap.Bootstrap as a main class and paste the
following VM option:

-Des.foreground=yes

Alternatively, you can run it from command line using the following
command in the elasticsearch root directory:

$ ES_CLASSPATH="target/classes:target/lib/*" bin/elasticsearch -f

You just need to make sure that all dependencies are assembled in the
target/lib directory by running

$ mvn prepare-package -DskipTests

On Monday, April 2, 2012 9:17:33 AM UTC-4, BARNEY wrote:

Hi,

I made very few changes in elasticsearch source code and I would like
to run a binary(./elasticsearch -f) of it by command line in
linux(ubuntu) after building it in intellij IDE.

getting error like this:
Exception in thread "main" java.lang.**NoClassDefFoundError: org/
elasticsearch/bootstrap/**Elasticsearch
Caused by: java.lang.**ClassNotFoundException:
org.elasticsearch.bootstrap.**Elasticsearch
at java.net.URLClassLoader$1.run(**URLClassLoader.java:217)
at java.security.**AccessController.doPrivileged(**Native
Method)
at java.net.URLClassLoader.**findClass(URLClassLoader.java:**205)

    at java.lang.ClassLoader.**loadClass(ClassLoader.java:**321)
    at sun.misc.Launcher$**AppClassLoader.loadClass(**Launcher.java:294)

    at java.lang.ClassLoader.**loadClass(ClassLoader.java:**266)

Could not find the main class:
org.elasticsearch.bootstrap.**Elasticsearch. Program will exit.

Please give me the solution.

Thanks,
Kalyan