You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Pushyami Gundala <pu...@umich.edu> on 2015/05/06 22:19:03 UTC

Fwd: Java8 and lucene version

Hi, We are using lucene 2.9.4 version for our application that has search.
We are planning on upgrading our application to run on java 8. My Question
is when we move to java 8 does the lucene-2.9.4 version still work? or i
need to upgrade to new version of lucene  to support  java 8.
Regards,
Pushyami

RE: Java8 and lucene version

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi again,
 
> There are two things to take into account:
> 
> Building with Java 8:
> - Lucene 2.9 is based on Java 1.4, so the build system passes "-source / -
> target 1.4" to the compiler, which is no longer supported in Java 8. So you
> cannot compile and test it without changing the build system. You have to
> build it with earlier versions.

I just checked, Java 8 still supports building Java 1.4 code:
warning: [options] source value 1.4 is obsolete and will be removed in a future release
warning: [options] target value 1.4 is obsolete and will be removed in a future release

But Java 9 already dropped support completely (1.4 and 1.5). So you may be able to compile, but running tests is harder... (see previous mail).
 
> Running with Java 8 (with precompiled binaries from Maven Central or the
> binary downloads):
> It should work with Java 8, but you should in any case test it. One example
> that uses Lucene 3.3.0 (a bit newer, based on Java 5) is "Atlassian JIRA". This
> one works perfectly fine with Java 8!
> 
> Uwe
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
> > -----Original Message-----
> > From: Erick Erickson [mailto:erickerickson@gmail.com]
> > Sent: Thursday, May 07, 2015 4:59 AM
> > To: java-user
> > Subject: Re: Java8 and lucene version
> >
> > I'd just grab the source, build it and run the tests. WARNING: this is
> > so old that I don't have much experience with it...
> >
> > Short form:
> > Check out the code, something like: svn checkout
> > https://svn.apache.org/repos/asf/lucene/java/tags/lucene_2_9_4
> > lucene_2_9_4
> > build it by going to the directory lucene_2_9_4 (or thereabouts) and
> > execute the target "ant test". See what happens.
> >
> > But this is largely uncharted waters, so you're mostly on your own.
> >
> > Best,
> > Erick
> >
> >
> > On Wed, May 6, 2015 at 7:47 PM, Jason Wee <pe...@gmail.com> wrote:
> > > The difficult way is to go through lucene code and read if is work
> > > with java 8. If you can duplicate the index created with lucene
> > > 2.9.4, perhaps you can try to upgrade java in test environment, it
> > > should give some direct indication or result (for example,
> > > exception, index cannot write/read, etc) immediately.
> > >
> > > hth
> > >
> > > jason
> > >
> > > On Thu, May 7, 2015 at 4:19 AM, Pushyami Gundala
> > <pu...@umich.edu> wrote:
> > >
> > >> Hi, We are using lucene 2.9.4 version for our application that has search.
> > >> We are planning on upgrading our application to run on java 8. My
> > >> Question is when we move to java 8 does the lucene-2.9.4 version
> > >> still work? or i need to upgrade to new version of lucene  to
> > >> support  java
> > 8.
> > >> Regards,
> > >> Pushyami
> > >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: Java8 and lucene version

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

There are two things to take into account:

Building with Java 8:
- many tests don't even pass with Java 7, because the order of reflected methods is not the same as in source code. Also some tests of Solr relied on order of hash maps which changed with Java 8 (this also affects early Lucene/Solr 3 versions). These were "wrong assumptions" about how the JVM behaves, which changed with Java 7 and Java 8.
- Lucene 2.9 is based on Java 1.4, so the build system passes "-source / -target 1.4" to the compiler, which is no longer supported in Java 8. So you cannot compile and test it without changing the build system. You have to build it with earlier versions.

Running with Java 8 (with precompiled binaries from Maven Central or the binary downloads):
It should work with Java 8, but you should in any case test it. One example that uses Lucene 3.3.0 (a bit newer, based on Java 5) is "Atlassian JIRA". This one works perfectly fine with Java 8!

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Erick Erickson [mailto:erickerickson@gmail.com]
> Sent: Thursday, May 07, 2015 4:59 AM
> To: java-user
> Subject: Re: Java8 and lucene version
> 
> I'd just grab the source, build it and run the tests. WARNING: this is so old
> that I don't have much experience with it...
> 
> Short form:
> Check out the code, something like: svn checkout
> https://svn.apache.org/repos/asf/lucene/java/tags/lucene_2_9_4
> lucene_2_9_4
> build it by going to the directory lucene_2_9_4 (or thereabouts) and execute
> the target "ant test". See what happens.
> 
> But this is largely uncharted waters, so you're mostly on your own.
> 
> Best,
> Erick
> 
> 
> On Wed, May 6, 2015 at 7:47 PM, Jason Wee <pe...@gmail.com> wrote:
> > The difficult way is to go through lucene code and read if is work
> > with java 8. If you can duplicate the index created with lucene 2.9.4,
> > perhaps you can try to upgrade java in test environment, it should
> > give some direct indication or result (for example, exception, index
> > cannot write/read, etc) immediately.
> >
> > hth
> >
> > jason
> >
> > On Thu, May 7, 2015 at 4:19 AM, Pushyami Gundala
> <pu...@umich.edu> wrote:
> >
> >> Hi, We are using lucene 2.9.4 version for our application that has search.
> >> We are planning on upgrading our application to run on java 8. My
> >> Question is when we move to java 8 does the lucene-2.9.4 version
> >> still work? or i need to upgrade to new version of lucene  to support  java
> 8.
> >> Regards,
> >> Pushyami
> >>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Java8 and lucene version

Posted by Erick Erickson <er...@gmail.com>.
I'd just grab the source, build it and run the tests. WARNING: this is
so old that I don't have much experience with it...

Short form:
Check out the code, something like: svn checkout
https://svn.apache.org/repos/asf/lucene/java/tags/lucene_2_9_4
lucene_2_9_4
build it by going to the directory lucene_2_9_4 (or thereabouts) and
execute the target "ant test". See what happens.

But this is largely uncharted waters, so you're mostly on your own.

Best,
Erick


On Wed, May 6, 2015 at 7:47 PM, Jason Wee <pe...@gmail.com> wrote:
> The difficult way is to go through lucene code and read if is work with
> java 8. If you can duplicate the index created with lucene 2.9.4, perhaps
> you can try to upgrade java in test environment, it should give some direct
> indication or result (for example, exception, index cannot write/read, etc)
> immediately.
>
> hth
>
> jason
>
> On Thu, May 7, 2015 at 4:19 AM, Pushyami Gundala <pu...@umich.edu> wrote:
>
>> Hi, We are using lucene 2.9.4 version for our application that has search.
>> We are planning on upgrading our application to run on java 8. My Question
>> is when we move to java 8 does the lucene-2.9.4 version still work? or i
>> need to upgrade to new version of lucene  to support  java 8.
>> Regards,
>> Pushyami
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Java8 and lucene version

Posted by Jason Wee <pe...@gmail.com>.
The difficult way is to go through lucene code and read if is work with
java 8. If you can duplicate the index created with lucene 2.9.4, perhaps
you can try to upgrade java in test environment, it should give some direct
indication or result (for example, exception, index cannot write/read, etc)
immediately.

hth

jason

On Thu, May 7, 2015 at 4:19 AM, Pushyami Gundala <pu...@umich.edu> wrote:

> Hi, We are using lucene 2.9.4 version for our application that has search.
> We are planning on upgrading our application to run on java 8. My Question
> is when we move to java 8 does the lucene-2.9.4 version still work? or i
> need to upgrade to new version of lucene  to support  java 8.
> Regards,
> Pushyami
>