You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Achim Domma <do...@procoders.net> on 2013/05/31 10:52:48 UTC

Setting up a development environment

I would like to work with the Solr source code. My idea is to "debug" some unit tests to get a better understanding of the inner workings of Solr. And perhaps I might implement some custom code in the future. But to get started, I need a working development environment where I can build and debug the Solr source code. For a non-java-guru this points out to be quite complicated:

I tried to follow the "How to contribute" and "How to configure Eclipse" sections in the wiki, but ran in many problems. Just to give some examples: I checked out the code via SVN and called "ant eclipse". This took quite some time and had to restart the task serveral times due to "freezing" downloads. Then I created a project in Eclipse, but I'm not sure if I did I right. Looks like the description is for an older version of Eclipse and I'm using the latest one. I tried to run the unit tests (having added -ea before) but got quite some strange errors. I checked the web and found some readme that told me, that I have to use Java6. As I was using Java8 (Oracle version for Linux) I removed this version and installed Java6. Running the tests again I got messages that some tests require Java7!? Then I wanted to give the Git version (which is referenced on the wiki page) a try, but it seems not to exist anymore.

I'm an experienced developer, willing to read documentation, but as I'm not a java person, it's impossible to see wether I'm using a wrong version, doing something wrong or whether the documentation is just out dated.

Is there some information I'm missing? Or could somebody give me a starting point? I'm very open to the tools to use. If IntelliJ is the prefered IDE, I'll install it. OpenJDK or the Oracle version? I don't care. Just tell me what combination will work and I'll give it a try.

kind regards,
Achim

Re: Setting up a development environment

Posted by Achim Domma <do...@procoders.net>.
Shalin and Shawn, thanks for your help! Just for the records, in case somebody else having the same problems will read this thread:

I'm using Ubuntu 13.02, ant 1.8.2, Oracle Java 1.7.0_21-b11 and the community edition of IntelliJ 12. I followed the steps outlined by Shalin. Everything works like a charm, all tests pass and I'm now looking forward to dig into the code. :-)

cheers,
Achim


Am 31.05.2013 um 16:22 schrieb Shawn Heisey:

> On 5/31/2013 4:17 AM, Shalin Shekhar Mangar wrote:
>> The "trunk" requires Java7 but the 4.x releases are cut from branch_4x
>> which is on Java6. There are some bugs in Java8 which cause test failures
>> on our build machines so just avoid it for now. I use IntelliJ so I cannot
>> comment on the problems you faced with eclipse but plenty of other
>> developers use eclipse with lucene/solr so it is indeed supported. Oracle
>> Java is the way to go.
>> 
>> We may be able to help you more if you specify the errors you saw while
>> running the tests.
>> 
>> Just for reference, here's what I use:
>> IDE: IntelliJ Ultimate (the community edition also runs fine)
>> Java: Oracle Java 1.7.0_17
>> Ant: 1.8.4
>> 
>> Steps to get started:
>> 1. Checkout trunk from svn
>> 2. ant ivy-bootstrap
>> 3. ant idea
>> 4. Open project in IntelliJ Idea, goto "Project Structure" and choose the
>> installed JVM (sometimes it does not happen automatically)
> 
> Shalin has given you all the important info.  I'd just like to add one
> thought: On some systems, particularly those with Redhat DNA (RHEL,
> CentOS, Fedora, Scientific), the packaged ant is broken.  For those, you
> should download the latest ant 1.8.x from ant.apache.org, extract it
> somewhere, and either modify your path so it gets found before the
> packaged ant, or set an environment variable to point at the right location:
> 
> export ANT_HOME=/usr/local/apache-ant-1.8.4
> 
> The packaged ant on Debian seems to work fine, so Ubuntu and other
> derivatives probably also work.
> 
> I have not tried ant 1.9.x, so I don't know whether that would work.
> Lucene/Solr 3.x required ant 1.7.x, it would not work with 1.8.x.  Based
> on that historical information, I would not try ant 1.9.x until it has
> been officially blessed by the project.
> 
> Thanks,
> Shawn
> 


Re: Setting up a development environment

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/31/2013 4:17 AM, Shalin Shekhar Mangar wrote:
> The "trunk" requires Java7 but the 4.x releases are cut from branch_4x
> which is on Java6. There are some bugs in Java8 which cause test failures
> on our build machines so just avoid it for now. I use IntelliJ so I cannot
> comment on the problems you faced with eclipse but plenty of other
> developers use eclipse with lucene/solr so it is indeed supported. Oracle
> Java is the way to go.
> 
> We may be able to help you more if you specify the errors you saw while
> running the tests.
> 
> Just for reference, here's what I use:
> IDE: IntelliJ Ultimate (the community edition also runs fine)
> Java: Oracle Java 1.7.0_17
> Ant: 1.8.4
> 
> Steps to get started:
> 1. Checkout trunk from svn
> 2. ant ivy-bootstrap
> 3. ant idea
> 4. Open project in IntelliJ Idea, goto "Project Structure" and choose the
> installed JVM (sometimes it does not happen automatically)

Shalin has given you all the important info.  I'd just like to add one
thought: On some systems, particularly those with Redhat DNA (RHEL,
CentOS, Fedora, Scientific), the packaged ant is broken.  For those, you
should download the latest ant 1.8.x from ant.apache.org, extract it
somewhere, and either modify your path so it gets found before the
packaged ant, or set an environment variable to point at the right location:

export ANT_HOME=/usr/local/apache-ant-1.8.4

The packaged ant on Debian seems to work fine, so Ubuntu and other
derivatives probably also work.

I have not tried ant 1.9.x, so I don't know whether that would work.
Lucene/Solr 3.x required ant 1.7.x, it would not work with 1.8.x.  Based
on that historical information, I would not try ant 1.9.x until it has
been officially blessed by the project.

Thanks,
Shawn


Re: Setting up a development environment

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, May 31, 2013 at 2:22 PM, Achim Domma <do...@procoders.net> wrote:

> I would like to work with the Solr source code. My idea is to "debug" some
> unit tests to get a better understanding of the inner workings of Solr. And
> perhaps I might implement some custom code in the future. But to get
> started, I need a working development environment where I can build and
> debug the Solr source code. For a non-java-guru this points out to be quite
> complicated:
>
> I tried to follow the "How to contribute" and "How to configure Eclipse"
> sections in the wiki, but ran in many problems. Just to give some examples:
> I checked out the code via SVN and called "ant eclipse". This took quite
> some time and had to restart the task serveral times due to "freezing"
> downloads. Then I created a project in Eclipse, but I'm not sure if I did I
> right. Looks like the description is for an older version of Eclipse and
> I'm using the latest one. I tried to run the unit tests (having added -ea
> before) but got quite some strange errors. I checked the web and found some
> readme that told me, that I have to use Java6. As I was using Java8 (Oracle
> version for Linux) I removed this version and installed Java6. Running the
> tests again I got messages that some tests require Java7!? Then I wanted to
> give the Git version (which is referenced on the wiki page) a try, but it
> seems not to exist anymore.


> I'm an experienced developer, willing to read documentation, but as I'm
> not a java person, it's impossible to see wether I'm using a wrong version,
> doing something wrong or whether the documentation is just out dated.
>
> Is there some information I'm missing? Or could somebody give me a
> starting point? I'm very open to the tools to use. If IntelliJ is the
> prefered IDE, I'll install it. OpenJDK or the Oracle version? I don't care.
> Just tell me what combination will work and I'll give it a try.
>
>
The "trunk" requires Java7 but the 4.x releases are cut from branch_4x
which is on Java6. There are some bugs in Java8 which cause test failures
on our build machines so just avoid it for now. I use IntelliJ so I cannot
comment on the problems you faced with eclipse but plenty of other
developers use eclipse with lucene/solr so it is indeed supported. Oracle
Java is the way to go.

We may be able to help you more if you specify the errors you saw while
running the tests.

Just for reference, here's what I use:
IDE: IntelliJ Ultimate (the community edition also runs fine)
Java: Oracle Java 1.7.0_17
Ant: 1.8.4

Steps to get started:
1. Checkout trunk from svn
2. ant ivy-bootstrap
3. ant idea
4. Open project in IntelliJ Idea, goto "Project Structure" and choose the
installed JVM (sometimes it does not happen automatically)


-- 
Regards,
Shalin Shekhar Mangar.