# Error for /bin/elasticsearch -f

**URL:** <https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217>\
**Category:** Elasticsearch\
**Created:** [August 13, 2010, 8:34pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217 "2010-08-13T20:34:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted\_Karmel](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Ted\_Karmel](https://discuss.elastic.co/u/Ted_Karmel)\
**Post date:** [August 13, 2010, 8:34pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/1 "2010-08-13T20:34:43Z")

</div>

Hello,

I've downloaded and unzipped the source for elastic search onto Ubuntu  
Karmic 9.10. But, when I try to run :

bin/elasticsearch -f

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError:  
org/elasticsearch/bootstrap/Bootstrap  
...  
Could not find the main class: org.elasticsearch.bootstrap.Bootstrap.  
Program will exit.

The full error message can be seen in the screenshot image attachment.

Is there a problem with Java. I installed Java 6 smoothly via :

sudo apt-get install sun-java6-jre sun-java6-plugin

Should I install something additional? Should I configure  
ElasticSearch a certain way?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 13, 2010, 8:41pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/2 "2010-08-13T20:41:03Z")

</div>

When you use elasticsearch from source, you can't executed the script and  
start it. You need to build a distribution of elasticsearch and then use it.  
Execute "gradlew release" and you will find the distribution under  
build/distribution.

On Fri, Aug 13, 2010 at 11:34 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com) wrote:

> Hello,
> 
> I've downloaded and unzipped the source for Elasticsearch onto Ubuntu  
> Karmic 9.10. But, when I try to run :
> 
> bin/elasticsearch -f
> 
> I get the following error:
> 
> Exception in thread "main" java.lang.NoClassDefFoundError:  
> org/elasticsearch/bootstrap/Bootstrap  
> ...  
> Could not find the main class: org.elasticsearch.bootstrap.Bootstrap.  
> Program will exit.
> 
> The full error message can be seen in the screenshot image attachment.
> 
> Is there a problem with Java. I installed Java 6 smoothly via :
> 
> sudo apt-get install sun-java6-jre sun-java6-plugin
> 
> Should I install something additional? Should I configure  
> Elasticsearch a certain way?
> 
> Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Ted\_Karmel](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Ted\_Karmel](https://discuss.elastic.co/u/Ted_Karmel)\
**Post date:** [August 13, 2010, 8:51pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/3 "2010-08-13T20:51:26Z")

</div>

Thanks for the reply Shay. Sorry I am not familiar with gradlew and I  
get the error:

command not found

Is there a good source from where to install gradle or gradlew?

On Fri, Aug 13, 2010 at 10:41 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> When you use elasticsearch from source, you can't executed the script and  
> start it. You need to build a distribution of elasticsearch and then use it.  
> Execute "gradlew release" and you will find the distribution under  
> build/distribution.
> 
> On Fri, Aug 13, 2010 at 11:34 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com) wrote:
> 
> > Hello,
> > 
> > I've downloaded and unzipped the source for Elasticsearch onto Ubuntu  
> > Karmic 9.10. But, when I try to run :
> > 
> > bin/elasticsearch -f
> > 
> > I get the following error:
> > 
> > Exception in thread "main" java.lang.NoClassDefFoundError:  
> > org/elasticsearch/bootstrap/Bootstrap  
> > ...  
> > Could not find the main class: org.elasticsearch.bootstrap.Bootstrap.  
> > Program will exit.
> > 
> > The full error message can be seen in the screenshot image attachment.
> > 
> > Is there a problem with Java. I installed Java 6 smoothly via :
> > 
> > sudo apt-get install sun-java6-jre sun-java6-plugin
> > 
> > Should I install something additional? Should I configure  
> > Elasticsearch a certain way?
> > 
> > Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 13, 2010, 9:04pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/4 "2010-08-13T21:04:41Z")

</div>

gradlew comes with the source, its at the root of it.

On Fri, Aug 13, 2010 at 11:51 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com) wrote:

> Thanks for the reply Shay. Sorry I am not familiar with gradlew and I  
> get the error:
> 
> command not found
> 
> Is there a good source from where to install gradle or gradlew?
> 
> On Fri, Aug 13, 2010 at 10:41 PM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > When you use elasticsearch from source, you can't executed the script and  
> > start it. You need to build a distribution of elasticsearch and then use  
> > it.  
> > Execute "gradlew release" and you will find the distribution under  
> > build/distribution.
> > 
> > On Fri, Aug 13, 2010 at 11:34 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > wrote:
> > 
> > > Hello,
> > > 
> > > I've downloaded and unzipped the source for Elasticsearch onto Ubuntu  
> > > Karmic 9.10. But, when I try to run :
> > > 
> > > bin/elasticsearch -f
> > > 
> > > I get the following error:
> > > 
> > > Exception in thread "main" java.lang.NoClassDefFoundError:  
> > > org/elasticsearch/bootstrap/Bootstrap  
> > > ...  
> > > Could not find the main class: org.elasticsearch.bootstrap.Bootstrap.  
> > > Program will exit.
> > > 
> > > The full error message can be seen in the screenshot image attachment.
> > > 
> > > Is there a problem with Java. I installed Java 6 smoothly via :
> > > 
> > > sudo apt-get install sun-java6-jre sun-java6-plugin
> > > 
> > > Should I install something additional? Should I configure  
> > > Elasticsearch a certain way?
> > > 
> > > Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Ted\_Karmel](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Ted\_Karmel](https://discuss.elastic.co/u/Ted_Karmel)\
**Post date:** [August 15, 2010, 2:16pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/5 "2010-08-15T14:16:57Z")

</div>

Hi Shay,

Thanks for your reply. It seems I just had some JAVA\_HOME environment  
variable problems. I sorted that out however.

I get a successful build after executing gradlew. But, I receive an  
error for bin/elasticsearch -f (see attached screenshot image).

Do you think that is still a problem with Java? Or have I configured  
something incorrectly?

On Fri, Aug 13, 2010 at 11:04 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> gradlew comes with the source, its at the root of it.
> 
> On Fri, Aug 13, 2010 at 11:51 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com) wrote:
> 
> > Thanks for the reply Shay. Sorry I am not familiar with gradlew and I  
> > get the error:
> > 
> > command not found
> > 
> > Is there a good source from where to install gradle or gradlew?
> > 
> > On Fri, Aug 13, 2010 at 10:41 PM, Shay Banon  
> > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > 
> > > When you use elasticsearch from source, you can't executed the script  
> > > and  
> > > start it. You need to build a distribution of elasticsearch and then use  
> > > it.  
> > > Execute "gradlew release" and you will find the distribution under  
> > > build/distribution.
> > > 
> > > On Fri, Aug 13, 2010 at 11:34 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > > wrote:
> > > 
> > > > Hello,
> > > > 
> > > > I've downloaded and unzipped the source for Elasticsearch onto Ubuntu  
> > > > Karmic 9.10. But, when I try to run :
> > > > 
> > > > bin/elasticsearch -f
> > > > 
> > > > I get the following error:
> > > > 
> > > > Exception in thread "main" java.lang.NoClassDefFoundError:  
> > > > org/elasticsearch/bootstrap/Bootstrap  
> > > > ...  
> > > > Could not find the main class: org.elasticsearch.bootstrap.Bootstrap.  
> > > > Program will exit.
> > > > 
> > > > The full error message can be seen in the screenshot image attachment.
> > > > 
> > > > Is there a problem with Java. I installed Java 6 smoothly via :
> > > > 
> > > > sudo apt-get install sun-java6-jre sun-java6-plugin
> > > > 
> > > > Should I install something additional? Should I configure  
> > > > Elasticsearch a certain way?
> > > > 
> > > > Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 15, 2010, 2:23pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/6 "2010-08-15T14:23:05Z")

</div>

You can't executed bin/elasticsearch -f from within the source distribution.  
You need to extract the distribution built under build/distributions and use  
that.

-shay.banon

On Sun, Aug 15, 2010 at 5:16 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com) wrote:

> Hi Shay,
> 
> Thanks for your reply. It seems I just had some JAVA\_HOME environment  
> variable problems. I sorted that out however.
> 
> I get a successful build after executing gradlew. But, I receive an  
> error for bin/elasticsearch -f (see attached screenshot image).
> 
> Do you think that is still a problem with Java? Or have I configured  
> something incorrectly?
> 
> On Fri, Aug 13, 2010 at 11:04 PM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > gradlew comes with the source, its at the root of it.
> > 
> > On Fri, Aug 13, 2010 at 11:51 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > wrote:
> > 
> > > Thanks for the reply Shay. Sorry I am not familiar with gradlew and I  
> > > get the error:
> > > 
> > > command not found
> > > 
> > > Is there a good source from where to install gradle or gradlew?
> > > 
> > > On Fri, Aug 13, 2010 at 10:41 PM, Shay Banon  
> > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > > 
> > > > When you use elasticsearch from source, you can't executed the script  
> > > > and  
> > > > start it. You need to build a distribution of elasticsearch and then  
> > > > use  
> > > > it.  
> > > > Execute "gradlew release" and you will find the distribution under  
> > > > build/distribution.
> > > > 
> > > > On Fri, Aug 13, 2010 at 11:34 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > > > wrote:
> > > > 
> > > > > Hello,
> > > > > 
> > > > > I've downloaded and unzipped the source for Elasticsearch onto  
> > > > > Ubuntu  
> > > > > Karmic 9.10. But, when I try to run :
> > > > > 
> > > > > bin/elasticsearch -f
> > > > > 
> > > > > I get the following error:
> > > > > 
> > > > > Exception in thread "main" java.lang.NoClassDefFoundError:  
> > > > > org/elasticsearch/bootstrap/Bootstrap  
> > > > > ...  
> > > > > Could not find the main class: org.elasticsearch.bootstrap.Bootstrap.  
> > > > > Program will exit.
> > > > > 
> > > > > The full error message can be seen in the screenshot image  
> > > > > attachment.
> > > > > 
> > > > > Is there a problem with Java. I installed Java 6 smoothly via :
> > > > > 
> > > > > sudo apt-get install sun-java6-jre sun-java6-plugin
> > > > > 
> > > > > Should I install something additional? Should I configure  
> > > > > Elasticsearch a certain way?
> > > > > 
> > > > > Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Ted\_Karmel](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Ted\_Karmel](https://discuss.elastic.co/u/Ted_Karmel)\
**Post date:** [August 15, 2010, 9:26pm UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/7 "2010-08-15T21:26:21Z")

</div>

Woohoo! Beautiful. Bonsai Beautiful!

Pardon the noobiness of the question and thanks again Shay for putting  
up with them.

I'll put together an EC2 AMI for the community in case people just  
want to whip up a quick instance to do a basic test of elasticsearch.

On Sun, Aug 15, 2010 at 4:23 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> You can't executed bin/elasticsearch -f from within the source distribution.  
> You need to extract the distribution built under build/distributions and use  
> that.  
> -shay.banon
> 
> On Sun, Aug 15, 2010 at 5:16 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com) wrote:
> 
> > Hi Shay,
> > 
> > Thanks for your reply. It seems I just had some JAVA\_HOME environment  
> > variable problems. I sorted that out however.
> > 
> > I get a successful build after executing gradlew. But, I receive an  
> > error for bin/elasticsearch -f (see attached screenshot image).
> > 
> > Do you think that is still a problem with Java? Or have I configured  
> > something incorrectly?
> > 
> > On Fri, Aug 13, 2010 at 11:04 PM, Shay Banon  
> > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > 
> > > gradlew comes with the source, its at the root of it.
> > > 
> > > On Fri, Aug 13, 2010 at 11:51 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > > wrote:
> > > 
> > > > Thanks for the reply Shay. Sorry I am not familiar with gradlew and I  
> > > > get the error:
> > > > 
> > > > command not found
> > > > 
> > > > Is there a good source from where to install gradle or gradlew?
> > > > 
> > > > On Fri, Aug 13, 2010 at 10:41 PM, Shay Banon  
> > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > > > 
> > > > > When you use elasticsearch from source, you can't executed the script  
> > > > > and  
> > > > > start it. You need to build a distribution of elasticsearch and then  
> > > > > use  
> > > > > it.  
> > > > > Execute "gradlew release" and you will find the distribution under  
> > > > > build/distribution.
> > > > > 
> > > > > On Fri, Aug 13, 2010 at 11:34 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > > > > wrote:
> > > > > 
> > > > > > Hello,
> > > > > > 
> > > > > > I've downloaded and unzipped the source for Elasticsearch onto  
> > > > > > Ubuntu  
> > > > > > Karmic 9.10. But, when I try to run :
> > > > > > 
> > > > > > bin/elasticsearch -f
> > > > > > 
> > > > > > I get the following error:
> > > > > > 
> > > > > > Exception in thread "main" java.lang.NoClassDefFoundError:  
> > > > > > org/elasticsearch/bootstrap/Bootstrap  
> > > > > > ...  
> > > > > > Could not find the main class:  
> > > > > > org.elasticsearch.bootstrap.Bootstrap.  
> > > > > > Program will exit.
> > > > > > 
> > > > > > The full error message can be seen in the screenshot image  
> > > > > > attachment.
> > > > > > 
> > > > > > Is there a problem with Java. I installed Java 6 smoothly via :
> > > > > > 
> > > > > > sudo apt-get install sun-java6-jre sun-java6-plugin
> > > > > > 
> > > > > > Should I install something additional? Should I configure  
> > > > > > Elasticsearch a certain way?
> > > > > > 
> > > > > > Thanks in advance.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 16, 2010, 6:49am UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/8 "2010-08-16T06:49:00Z")

</div>

Sounds good!. By the way, the main drawback I found to great the best AMI is  
the ability to pass (or get) the user credentials to the machine starting so  
automatic ec2 discovery will work and (optionally) s3 gateway.

Also, I do hope to find how to get gradle to fork a java process that will  
be elasticsearch so there won't be a need to build a distribution just  
something like "gradlew run".

-shay.banon

On Mon, Aug 16, 2010 at 12:26 AM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com) wrote:

> Woohoo! Beautiful. Bonsai Beautiful!
> 
> Pardon the noobiness of the question and thanks again Shay for putting  
> up with them.
> 
> I'll put together an EC2 AMI for the community in case people just  
> want to whip up a quick instance to do a basic test of elasticsearch.
> 
> On Sun, Aug 15, 2010 at 4:23 PM, Shay Banon  
> [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> 
> > You can't executed bin/elasticsearch -f from within the source  
> > distribution.  
> > You need to extract the distribution built under build/distributions and  
> > use  
> > that.  
> > -shay.banon
> > 
> > On Sun, Aug 15, 2010 at 5:16 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > wrote:
> > 
> > > Hi Shay,
> > > 
> > > Thanks for your reply. It seems I just had some JAVA\_HOME environment  
> > > variable problems. I sorted that out however.
> > > 
> > > I get a successful build after executing gradlew. But, I receive an  
> > > error for bin/elasticsearch -f (see attached screenshot image).
> > > 
> > > Do you think that is still a problem with Java? Or have I configured  
> > > something incorrectly?
> > > 
> > > On Fri, Aug 13, 2010 at 11:04 PM, Shay Banon  
> > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > > 
> > > > gradlew comes with the source, its at the root of it.
> > > > 
> > > > On Fri, Aug 13, 2010 at 11:51 PM, Ted Karmel [ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)  
> > > > wrote:
> > > > 
> > > > > Thanks for the reply Shay. Sorry I am not familiar with gradlew and  
> > > > > I  
> > > > > get the error:
> > > > > 
> > > > > command not found
> > > > > 
> > > > > Is there a good source from where to install gradle or gradlew?
> > > > > 
> > > > > On Fri, Aug 13, 2010 at 10:41 PM, Shay Banon  
> > > > > [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:
> > > > > 
> > > > > > When you use elasticsearch from source, you can't executed the  
> > > > > > script  
> > > > > > and  
> > > > > > start it. You need to build a distribution of elasticsearch and  
> > > > > > then  
> > > > > > use  
> > > > > > it.  
> > > > > > Execute "gradlew release" and you will find the distribution under  
> > > > > > build/distribution.
> > > > > > 
> > > > > > On Fri, Aug 13, 2010 at 11:34 PM, Ted Karmel \<[ted.karmel@gmail.com](mailto:ted.karmel@gmail.com)
> > 
> > > > > > wrote:
> > > > > > 
> > > > > > > Hello,
> > > > > > > 
> > > > > > > I've downloaded and unzipped the source for Elasticsearch onto  
> > > > > > > Ubuntu  
> > > > > > > Karmic 9.10. But, when I try to run :
> > > > > > > 
> > > > > > > bin/elasticsearch -f
> > > > > > > 
> > > > > > > I get the following error:
> > > > > > > 
> > > > > > > Exception in thread "main" java.lang.NoClassDefFoundError:  
> > > > > > > org/elasticsearch/bootstrap/Bootstrap  
> > > > > > > ...  
> > > > > > > Could not find the main class:  
> > > > > > > org.elasticsearch.bootstrap.Bootstrap.  
> > > > > > > Program will exit.
> > > > > > > 
> > > > > > > The full error message can be seen in the screenshot image  
> > > > > > > attachment.
> > > > > > > 
> > > > > > > Is there a problem with Java. I installed Java 6 smoothly via :
> > > > > > > 
> > > > > > > sudo apt-get install sun-java6-jre sun-java6-plugin
> > > > > > > 
> > > > > > > Should I install something additional? Should I configure  
> > > > > > > Elasticsearch a certain way?
> > > > > > > 
> > > > > > > Thanks in advance.

---

<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, 4:20am UTC](https://discuss.elastic.co/t/error-for-bin-elasticsearch-f/3217/9 "2017-07-06T04:20:42Z")

</div>


