# Regarding gradle build through intellj

**URL:** https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850
**Category:** Elasticsearch
**Created:** [July 13, 2011, 11:03am UTC](https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850 "2011-07-13T11:03:15Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![arien](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@arien](https://discuss.elastic.co/u/arien)
#### Post date: [July 13, 2011, 11:03am UTC](https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850/1 "2011-07-13T11:03:15Z")

</div>

Hi;  
i imported the source code into IDEA IDE and wants to run gradle build  
der through IDE using build.gradle.I m new to gradle and IDEA too.when  
i try to run this gradle script through IDE i get class not found  
exceptions regarding gradle.  
In finding remedy for this i downloaded gradle and has given  
"gradle\_directory"/bin as gradle classpath.but still i m getting same  
exceptions.  
can someone tell me wat wrong i m doing in setting gradle in IDE.

Thnks,

---

<div class="post-metadata">

### Author: ![melix](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@melix](https://discuss.elastic.co/u/melix)
#### Post date: [July 13, 2011, 11:09am UTC](https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850/2 "2011-07-13T11:09:51Z")

</div>

I had the same problem. I solved it under linux using a simple sed  
script. First you need to perform a "./gradlew build" so that libraries  
get downloaded. Then open a terminal at the root of the project and enter :

# cd .idea

# for f in `ls libraries`; do sed -i

"s/USER\_HOME$/.gradle/GRADLE\_REPOSITORY$/g" libraries/$f; done

Then reopen your project.

CÃ©dric

Le 13/07/2011 13:03, arien a Ã©crit :

> Hi;  
> i imported the source code into IDEA IDE and wants to run gradle build  
> der through IDE using build.gradle.I m new to gradle and IDEA too.when  
> i try to run this gradle script through IDE i get class not found  
> exceptions regarding gradle.  
> In finding remedy for this i downloaded gradle and has given  
> "gradle\_directory"/bin as gradle classpath.but still i m getting same  
> exceptions.  
> can someone tell me wat wrong i m doing in setting gradle in IDE.
> 
> Thnks,

---

<div class="post-metadata">

### Author: ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)
#### Post date: [July 13, 2011, 12:24pm UTC](https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850/3 "2011-07-13T12:24:26Z")

</div>

Some time ago I wrote the following tutorial

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Hopefully it is not too dated.

Regards,  
Lukas

On Wed, Jul 13, 2011 at 1:09 PM, Cédric Champeau \<  
[cedric.champeau@lingway.com](mailto:cedric.champeau@lingway.com)\> wrote:

> I had the same problem. I solved it under linux using a simple sed script.  
> First you need to perform a "./gradlew build" so that libraries get  
> downloaded. Then open a terminal at the root of the project and enter :
> 
> # cd .idea
> 
> # for f in `ls libraries`; do sed -i "s/USER\_HOME$/.gradle/\*\*GRADLE\_REPOSITORY$/g"
> 
> libraries/$f; done
> 
> Then reopen your project.
> 
> Cédric
> 
> Le 13/07/2011 13:03, arien a écrit :
> 
> Hi;
> 
> > i imported the source code into IDEA IDE and wants to run gradle build  
> > der through IDE using build.gradle.I m new to gradle and IDEA too.when  
> > i try to run this gradle script through IDE i get class not found  
> > exceptions regarding gradle.  
> > In finding remedy for this i downloaded gradle and has given  
> > "gradle\_directory"/bin as gradle classpath.but still i m getting same  
> > exceptions.  
> > can someone tell me wat wrong i m doing in setting gradle in IDE.
> > 
> > Thnks,

---

<div class="post-metadata">

### Author: ![melix](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@melix](https://discuss.elastic.co/u/melix)
#### Post date: [July 13, 2011, 12:28pm UTC](https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850/4 "2011-07-13T12:28:22Z")

</div>

The tutorial looks fine to me, however the committed project files don't  
use GRADLE\_REPOSITORY path variable, but $USER\_HOME$/.gradle instead.  
That's why I had to perform some in place replacements.

Le 13/07/2011 14:24, LukÃ¡Å¡ VlÄek a Ã©crit :

> Some time ago I wrote the following tutorial  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/tutorials/2010/07/03/getting-started-with-sourcecode.html)
> 
> Hopefully it is not too dated.
> 
> Regards,  
> Lukas
> 
> On Wed, Jul 13, 2011 at 1:09 PM, CÃ©dric Champeau  
> \<[cedric.champeau@lingway.com](mailto:cedric.champeau@lingway.com) [mailto:cedric.champeau@lingway.com](mailto:cedric.champeau@lingway.com)\> wrote:
> 
> ```
> I had the same problem. I solved it under linux using a simple sed
> script. First you need to perform a "./gradlew build" so that
> libraries get downloaded. Then open a terminal at the root of the
> project and enter :
> 
> # cd .idea
> # for f in `ls libraries`; do sed -i
> "s/USER_HOME\$\/.gradle/GRADLE_REPOSITORY\$/g" libraries/$f; done
> 
> Then reopen your project.
> 
> CÃ©dric
> 
> Le 13/07/2011 13:03, arien a Ã©crit :
> 
> Hi;
> i imported the source code into IDEA IDE and wants to run
> gradle build
> der through IDE using build.gradle.I m new to gradle and IDEA
> too.when
> i try to run this gradle script through IDE i get class not found
> exceptions regarding gradle.
> In finding remedy for this i downloaded gradle and has given
> "gradle_directory"/bin as gradle classpath.but still i m
> getting same
> exceptions.
> can someone tell me wat wrong i m doing in setting gradle in IDE.
> 
> Thnks,
> 
> ```

---

<div class="post-metadata">

### Author: ![arien](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@arien](https://discuss.elastic.co/u/arien)
#### Post date: [July 13, 2011, 12:49pm UTC](https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850/5 "2011-07-13T12:49:01Z")

</div>

Hi;  
I tried ./gradle build but after some time (after half an hour) it  
shows tests built successfully and gets stuck..after (ctrl+c) when  
'ls' done;libraries folder doesnt show up.so cant perform sed action.

Here is the execption for more information:-

On Jul 13, 5:28 pm, Cédric Champeau [cedric.champ...@lingway.com](mailto:cedric.champ...@lingway.com)  
wrote:

> The tutorial looks fine to me, however the committed project files don't  
> use GRADLE\_REPOSITORY path variable, but $USER\_HOME$/.gradle instead.  
> That's why I had to perform some in place replaceme  
> /usr/lib/jvm/java-6-openjdk/bin/java -Dgradle.home=/home/fstl/  
> gradle-1.0-milestone-3/bin -Dtools.jar=/usr/lib/jvm/java-6-openjdk/lib/  
> tools.jar -Didea.launcher.port=7532 -Didea.launcher.bin.path=/home/  
> fstl/IntellJIDE/idea-IC-107.322/bin -Dfile.encoding=UTF-8 -classpath /  
> home/fstl/IntellJIDE/idea-IC-107.322/lib/idea\_rt.jar  
> com.intellij.rt.execution.application.AppMain  
> org.gradle.launcher.GradleMain --build-file /home/fstl/newElastic1/  
> elasticsearch/build.gradle  
> Exception in thread "main" java.lang.ClassNotFoundException:  
> org.gradle.launcher.GradleMain  
> 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)  
> at java.lang.Class.forName0(Native Method)  
> at java.lang.Class.forName(Class.java:186)  
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:

1. 

Process finished with exit code 1

Thanks;  
Arien

nts.

> Le 13/07/2011 14:24, Lukáš Vlček a écrit :
> 
> > Some time ago I wrote the following tutorial  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/tutorials/2010/07/03/getting-started-wit)...
> 
> > Hopefully it is not too dated.
> 
> > Regards,  
> > Lukas
> 
> > On Wed, Jul 13, 2011 at 1:09 PM, Cédric Champeau  
> > \<[cedric.champ...@lingway.com](mailto:cedric.champ...@lingway.com) [mailto:cedric.champ...@lingway.com](mailto:cedric.champ...@lingway.com)\> wrote:
> 
> > ```
> > I had the same problem. I solved it under linux using a simple sed
> > script. First you need to perform a "./gradlew build" so that
> > libraries get downloaded. Then open a terminal at the root of the
> > project and enter :
> > 
> > ```
> 
> > ```
> > # cd .idea
> > # for f in `ls libraries`; do sed -i
> > "s/USER_HOME\$\/.gradle/GRADLE_REPOSITORY\$/g" libraries/$f; done
> > 
> > ```
> 
> > ```
> > Then reopen your project.
> > 
> > ```
> 
> > ```
> > Cédric
> > 
> > ```
> 
> > ```
> > Le 13/07/2011 13:03, arien a écrit :
> > 
> > ```
> 
> > ```
> > Hi;
> > i imported the source code into IDEA IDE and wants to run
> > gradle build
> > der through IDE using build.gradle.I m new to gradle and IDEA
> > too.when
> > i try to run this gradle script through IDE i get class not found
> > exceptions regarding gradle.
> > In finding remedy for this i downloaded gradle and has given
> > "gradle_directory"/bin as gradle classpath.but still i m
> > getting same
> > exceptions.
> > can someone tell me wat wrong i m doing in setting gradle in IDE.
> > 
> > ```
> 
> > ```
> > Thnks,
> > 
> > ```

---

<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:00am UTC](https://discuss.elastic.co/t/regarding-gradle-build-through-intellj/4850/6 "2017-07-06T04:00:46Z")

</div>


