On 11/3/2015 3:33 PM, Erick Erickson wrote:
> You're on your one if you try to do this. Solr 4.10 requires Java7. I
> don't believe Solr will even compile under 1.6.
>
> You may bet lucky and get SolrJ to compile, but whether it works or
> not is chancy at best.
>
> Best,
> Erick
>
> On Tue, Nov 3, 2015 at 2:13 PM, O. Olson <olson_...@yahoo.it> wrote:
>> Hi,
>> I'm looking to compile the SolrJ for Solr 4.10.3 for running on Java 6.
>> (Due to choices beyond my control, we are on this older version of SolrJ and
>> Java 6.) I'm looking for any pointers on how I could do it?

Erick is right.  It won't even compile.  When the jump to Java 7 was
made between the 4.7 and 4.8 releases, most of the source code was
reviewed and certain pieces in a very large number of files were updated
to code that only compiles in Java 7.  Many of those changes happened in
SolrJ.  This was done because the Java 7 code is generally more reliable
and easier to maintain.

Here's what happens when I import the 4.10 branch into eclipse and
change the compiler compliance level to 1.6.  Notice the large number of
red marks that are on source packages and java files:

https://www.dropbox.com/s/kktym6tsdi3iu36/solrj-4.10-java6-errors.png?dl=0

Your best bet is to download the 4.7 version and try to use that.  This
is the last release that will work in Java 6:

http://archive.apache.org/dist/lucene/solr/4.7.2/

If you're NOT running SolrCloud, chances are VERY good that you can get
this to work with zero problems.  If you're running SolrCloud on version
4.10 and try to use SolrJ 4.7, I would not be surprised to learn that
they are not compatible.  It might work well ... I have never tried it.

The nature of the changes for Java 7 are such that it will be extremely
time-consuming to backport changes between 4.7.2 and 4.10.4 to the older
source code.

Thanks,
Shawn

Reply via email to