Java no class def found error while installing elasticsearch?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Java no class def found error while installing elasticsearch?

Jason Jiang
I followed these steps on https://github.com/karmi/tire to install
elasticsearch

curl -k -L -o elasticsearch-0.17.6.tar.gz
http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz

tar -zxvf elasticsearch-0.17.6.tar.gz

./elasticsearch-0.17.6/bin/elasticsearch -f

I am running this on MinGW on windows 7, and most of the process went
smoothly.

However, as I try to start the server with ./elasticsearch-0.17.6/bin/
elasticsearch -f I get a java no class def found error:

$ ./elasticsearch-0.17.6/bin/elasticsearch
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(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class:
org.elasticsearch.bootstrap.ElasticSearch.  Program will exit.

What gives?
Reply | Threaded
Open this post in threaded view
|

Re: Java no class def found error while installing elasticsearch?

Ivan Brusic
I am not familiar with the Ruby/Tire client, but if it is working via
HTTP, there should be no reason why you would not be able to work with
the latest ES version (0.18.6). Try installing the latest version and
see if you get the same error.

https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.6.tar.gz

Also, I am not sure if the -f flag works on Windows, but it still
would not be the cause of NoClassDefFoundError.

--
Ivan

On Fri, Dec 30, 2011 at 6:15 PM, Jason Jiang
<[hidden email]> wrote:

> I followed these steps on https://github.com/karmi/tire to install
> elasticsearch
>
> curl -k -L -o elasticsearch-0.17.6.tar.gz
> http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz
>
> tar -zxvf elasticsearch-0.17.6.tar.gz
>
> ./elasticsearch-0.17.6/bin/elasticsearch -f
>
> I am running this on MinGW on windows 7, and most of the process went
> smoothly.
>
> However, as I try to start the server with ./elasticsearch-0.17.6/bin/
> elasticsearch -f I get a java no class def found error:
>
> $ ./elasticsearch-0.17.6/bin/elasticsearch
> 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(Unknown Source)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(Unknown Source)
>        at java.lang.ClassLoader.loadClass(Unknown Source)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>        at java.lang.ClassLoader.loadClass(Unknown Source)
> Could not find the main class:
> org.elasticsearch.bootstrap.ElasticSearch.  Program will exit.
>
> What gives?
Reply | Threaded
Open this post in threaded view
|

Re: Java no class def found error while installing elasticsearch?

kimchy
Administrator
In reply to this post by Jason Jiang
It might be a problem wiht MinGW and installing elasticsearch in a path with spaces. Frist, try and see if you still get it with the latest elasticsearch (0.18.6). If it still happens, they some path variables should probably be quoted (which one does MinGW calls, the elasticsearch.bat one or the elasticsearch one?).

On Sat, Dec 31, 2011 at 4:15 AM, Jason Jiang <[hidden email]> wrote:
I followed these steps on https://github.com/karmi/tire to install
elasticsearch

curl -k -L -o elasticsearch-0.17.6.tar.gz
http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz

tar -zxvf elasticsearch-0.17.6.tar.gz

./elasticsearch-0.17.6/bin/elasticsearch -f

I am running this on MinGW on windows 7, and most of the process went
smoothly.

However, as I try to start the server with ./elasticsearch-0.17.6/bin/
elasticsearch -f I get a java no class def found error:

$ ./elasticsearch-0.17.6/bin/elasticsearch
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(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
       at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class:
org.elasticsearch.bootstrap.ElasticSearch.  Program will exit.

What gives?

Reply | Threaded
Open this post in threaded view
|

Re: Java no class def found error while installing elasticsearch?

Jason Jiang
Yeah It did turn out to be a MinGW problem. I had to use windows style
paths instead of unix style paths for classpath and it is working now.

Thanks guys

On Dec 31, 2:47 am, Shay Banon <[hidden email]> wrote:

> It might be a problem wiht MinGW and installing elasticsearch in a path
> with spaces. Frist, try and see if you still get it with the latest
> elasticsearch (0.18.6). If it still happens, they some path variables
> should probably be quoted (which one does MinGW calls, the
> elasticsearch.bat one or the elasticsearch one?).
>
> On Sat, Dec 31, 2011 at 4:15 AM, Jason Jiang
> <[hidden email]>wrote:
>
>
>
>
>
>
>
> > I followed these steps onhttps://github.com/karmi/tireto install
> > elasticsearch
>
> > curl -k -L -o elasticsearch-0.17.6.tar.gz
>
> >http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch...
>
> > tar -zxvf elasticsearch-0.17.6.tar.gz
>
> > ./elasticsearch-0.17.6/bin/elasticsearch -f
>
> > I am running this on MinGW on windows 7, and most of the process went
> > smoothly.
>
> > However, as I try to start the server with ./elasticsearch-0.17.6/bin/
> > elasticsearch -f I get a java no class def found error:
>
> > $ ./elasticsearch-0.17.6/bin/elasticsearch
> > 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(Unknown Source)
> >        at java.security.AccessController.doPrivileged(Native Method)
> >        at java.net.URLClassLoader.findClass(Unknown Source)
> >        at java.lang.ClassLoader.loadClass(Unknown Source)
> >        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> >        at java.lang.ClassLoader.loadClass(Unknown Source)
> > Could not find the main class:
> > org.elasticsearch.bootstrap.ElasticSearch.  Program will exit.
>
> > What gives?