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 Abu Abdullah <fa...@gmail.com> on 2017/07/28 04:32:55 UTC

Java 9 issues

Hi,

I'm trying to compile my app in java 9 where i hit an issue related to
the module system of java 9. the current lucene libraries (JARs) have
the same classes in multiple JARs (considered modules in java9). the
error thrown is:

error: module ant reads package org.apache.lucene.analysis.standard
from both lucene.core and lucene.analyzers.common
error: module lucene.highlighter reads package
org.apache.lucene.search from both lucene.sandbox and lucene.core
error: module lucene.highlighter reads package
org.apache.lucene.document from both lucene.sandbox and lucene.core
error: module lucene.highlighter reads package
org.apache.lucene.analysis.standard from both lucene.core and
lucene.analyzers.common


and many more ...

the module system checks that no two named modules split a package.
the only option i have seen to solve this is to use the --patch-module
but it seems not working for me e.g.

javac --module-path lib --patch-module
lucene.core=lucene.analyzers.common -d mods/com.myApp
src/module-info.java src/com/myApp/*


any support is appreciated

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


Re: Java 9 issues

Posted by Dawid Weiss <da...@gmail.com>.
> it will be good if Lucene team can share their plans for a full java 9
> support (e.g. named modules of Lucene libraries)

So, here it is: we plan to support it. (*)

Dawid

(*) When it's stabilized and documented (it still isn't) [1]. And when
somebody has the time to do it (patches welcome, it's a major overhaul
of the build system, backward compatibility, conceptual separation of
modules, etc.).

[1] http://markmail.org/thread/rzszbyccnteylh2k

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


Re: Java 9 issues

Posted by Abu Abdullah <fa...@gmail.com>.
thank you.
it will be good if Lucene team can share their plans for a full java 9
support (e.g. named modules of Lucene libraries)

On Fri, Jul 28, 2017 at 10:38 AM, Uwe Schindler <uw...@thetaphi.de> wrote:
> Hi, small correction:
>
>> as with OSGI, there is currently no support for running Lucene in Java 9. This
>
> I mean "Java 9 module system". It works with Java 9!
>
>> requires a complete restructure of the Lucene/Solr package structure and
>> that's not going to happen in the next release. You should compile and run
>> Lucene with the standard classpath where it works without any problems!
>> Don't put the JAR files as auto-modules on the module-path (neither at
>> runtime nor at compile time). So stay with classpath and all should be fine.
>>
>> FYI, when placed on classpath, Apache Lucene and Solr (latest 6.x) versions
>> are compatible with the module system and its restrictions (it works with
>> illegal-access=deny and we run our tests with it), but you cannot make
>> modules out of the JARs.
>>
>> One solutions is possible: Combine all Lucene JARs to one Uber JAR file using
>> Maven Shade plugin and use that as a "single huge module".
>>
>> Uwe
>>
>> -----
>> Uwe Schindler
>> Achterdiek 19, D-28357 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>>
>> > -----Original Message-----
>> > From: Abu Abdullah [mailto:falcon.sheep@gmail.com]
>> > Sent: Friday, July 28, 2017 6:33 AM
>> > To: java-user@lucene.apache.org
>> > Subject: Java 9 issues
>> >
>> > Hi,
>> >
>> > I'm trying to compile my app in java 9 where i hit an issue related to
>> > the module system of java 9. the current lucene libraries (JARs) have
>> > the same classes in multiple JARs (considered modules in java9). the
>> > error thrown is:
>> >
>> > error: module ant reads package org.apache.lucene.analysis.standard
>> > from both lucene.core and lucene.analyzers.common
>> > error: module lucene.highlighter reads package
>> > org.apache.lucene.search from both lucene.sandbox and lucene.core
>> > error: module lucene.highlighter reads package
>> > org.apache.lucene.document from both lucene.sandbox and lucene.core
>> > error: module lucene.highlighter reads package
>> > org.apache.lucene.analysis.standard from both lucene.core and
>> > lucene.analyzers.common
>> >
>> >
>> > and many more ...
>> >
>> > the module system checks that no two named modules split a package.
>> > the only option i have seen to solve this is to use the --patch-module
>> > but it seems not working for me e.g.
>> >
>> > javac --module-path lib --patch-module
>> > lucene.core=lucene.analyzers.common -d mods/com.myApp
>> > src/module-info.java src/com/myApp/*
>> >
>> >
>> > any support is appreciated
>> >
>> > ---------------------------------------------------------------------
>> > 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: Java 9 issues

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

> as with OSGI, there is currently no support for running Lucene in Java 9. This

I mean "Java 9 module system". It works with Java 9!

> requires a complete restructure of the Lucene/Solr package structure and
> that's not going to happen in the next release. You should compile and run
> Lucene with the standard classpath where it works without any problems!
> Don't put the JAR files as auto-modules on the module-path (neither at
> runtime nor at compile time). So stay with classpath and all should be fine.
> 
> FYI, when placed on classpath, Apache Lucene and Solr (latest 6.x) versions
> are compatible with the module system and its restrictions (it works with
> illegal-access=deny and we run our tests with it), but you cannot make
> modules out of the JARs.
> 
> One solutions is possible: Combine all Lucene JARs to one Uber JAR file using
> Maven Shade plugin and use that as a "single huge module".
> 
> Uwe
> 
> -----
> Uwe Schindler
> Achterdiek 19, D-28357 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> > -----Original Message-----
> > From: Abu Abdullah [mailto:falcon.sheep@gmail.com]
> > Sent: Friday, July 28, 2017 6:33 AM
> > To: java-user@lucene.apache.org
> > Subject: Java 9 issues
> >
> > Hi,
> >
> > I'm trying to compile my app in java 9 where i hit an issue related to
> > the module system of java 9. the current lucene libraries (JARs) have
> > the same classes in multiple JARs (considered modules in java9). the
> > error thrown is:
> >
> > error: module ant reads package org.apache.lucene.analysis.standard
> > from both lucene.core and lucene.analyzers.common
> > error: module lucene.highlighter reads package
> > org.apache.lucene.search from both lucene.sandbox and lucene.core
> > error: module lucene.highlighter reads package
> > org.apache.lucene.document from both lucene.sandbox and lucene.core
> > error: module lucene.highlighter reads package
> > org.apache.lucene.analysis.standard from both lucene.core and
> > lucene.analyzers.common
> >
> >
> > and many more ...
> >
> > the module system checks that no two named modules split a package.
> > the only option i have seen to solve this is to use the --patch-module
> > but it seems not working for me e.g.
> >
> > javac --module-path lib --patch-module
> > lucene.core=lucene.analyzers.common -d mods/com.myApp
> > src/module-info.java src/com/myApp/*
> >
> >
> > any support is appreciated
> >
> > ---------------------------------------------------------------------
> > 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: Java 9 issues

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

as with OSGI, there is currently no support for running Lucene in Java 9. This requires a complete restructure of the Lucene/Solr package structure and that's not going to happen in the next release. You should compile and run Lucene with the standard classpath where it works without any problems! Don't put the JAR files as auto-modules on the module-path (neither at runtime nor at compile time). So stay with classpath and all should be fine.

FYI, when placed on classpath, Apache Lucene and Solr (latest 6.x) versions are compatible with the module system and its restrictions (it works with illegal-access=deny and we run our tests with it), but you cannot make modules out of the JARs. 

One solutions is possible: Combine all Lucene JARs to one Uber JAR file using Maven Shade plugin and use that as a "single huge module".

Uwe

-----
Uwe Schindler
Achterdiek 19, D-28357 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Abu Abdullah [mailto:falcon.sheep@gmail.com]
> Sent: Friday, July 28, 2017 6:33 AM
> To: java-user@lucene.apache.org
> Subject: Java 9 issues
> 
> Hi,
> 
> I'm trying to compile my app in java 9 where i hit an issue related to
> the module system of java 9. the current lucene libraries (JARs) have
> the same classes in multiple JARs (considered modules in java9). the
> error thrown is:
> 
> error: module ant reads package org.apache.lucene.analysis.standard
> from both lucene.core and lucene.analyzers.common
> error: module lucene.highlighter reads package
> org.apache.lucene.search from both lucene.sandbox and lucene.core
> error: module lucene.highlighter reads package
> org.apache.lucene.document from both lucene.sandbox and lucene.core
> error: module lucene.highlighter reads package
> org.apache.lucene.analysis.standard from both lucene.core and
> lucene.analyzers.common
> 
> 
> and many more ...
> 
> the module system checks that no two named modules split a package.
> the only option i have seen to solve this is to use the --patch-module
> but it seems not working for me e.g.
> 
> javac --module-path lib --patch-module
> lucene.core=lucene.analyzers.common -d mods/com.myApp
> src/module-info.java src/com/myApp/*
> 
> 
> any support is appreciated
> 
> ---------------------------------------------------------------------
> 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