Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Errors with Java while trying to install lucene.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
StifflerStealth
Retired Dev
Retired Dev


Joined: 03 Jul 2002
Posts: 968

PostPosted: Thu Mar 18, 2010 12:09 pm    Post subject: [solved] Errors with Java while trying to install lucene. Reply with quote

Hey all,

I have several issues with Java while trying to install dev-java/lucene-2.4.1

I know what causes the error, but I don't know how to fix it. The output is here:
Quote:
* Disabling all optional ANT_TASKS
Buildfile: /var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1/build.xml

javacc-uptodate-check:

javacc-notice:

jflex-uptodate-check:

jflex-notice:

init:

clover.setup:

clover.info:
[echo]
[echo] Clover not found. Code coverage reports disabled.
[echo]

clover:

common.compile-core:
[mkdir] Created dir: /var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1/build/classes/java
[javac] Compiling 330 source files to /var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1/build/classes/java
[javac] /var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1/src/java/org/apache/lucene/queryParser/CharStream.java:30: annotations are not supported in -source 1.4
[javac] (use -source 5 or higher to enable annotations)

[javac] @Deprecated
[javac] ^
[javac] /var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1/src/java/org/apache/lucene/queryParser/QueryParser.java:1659: generics are not supported in -source 1.4
[javac] (use -source 5 or higher to enable generics)

[javac] private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
[javac] ^
[javac] 2 errors

BUILD FAILED
/var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1/common-build.xml:183: The following error occurred while executing this line:
/var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1/common-build.xml:409: Compile failed; see the compiler error output for details.

Total time: 3 seconds
* ERROR: dev-java/lucene-2.4.1 failed:
* eant failed
*
* Call stack:
* ebuild.sh, line 48: Called src_compile
* environment, line 4369: Called eant '-Dversion=2.4.1' 'jar-core' 'jar-demo'
* environment, line 945: Called die
* The specific snippet of code:
* ant ${antflags} "${@}" || die "eant failed"
*
* If you need support, post the output of 'emerge --info =dev-java/lucene-2.4.1',
* the complete build log and the output of 'emerge -pqv =dev-java/lucene-2.4.1'.
!!! When you file a bug report, please include the following information:
GENTOO_VM=icedtea6-bin CLASSPATH="" JAVA_HOME="/opt/icedtea6-bin-1.7.1"
JAVACFLAGS="-source 1.4 -target 1.4" COMPILER="javac"

and of course, the output of emerge --info
* The complete build log is located at '/var/tmp/portage/work/portage/dev-java/lucene-2.4.1/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/work/portage/dev-java/lucene-2.4.1/temp/environment'.
* S: '/var/tmp/portage/work/portage/dev-java/lucene-2.4.1/work/lucene-2.4.1'

>>> Failed to emerge dev-java/lucene-2.4.1, Log file:


The first half of the build succeeds, but the second one fails. I bolded some things for you. First, it's trying to use 1.4 source when it needs 1.5. There is nothing in the ebuild to set that option, so it must be set on the system somewhere.

Second, notice how it says that my vm is icedtea-6? After it failed the first time I switched my vm to sun-jdk whatever the latest is, and did the usual env-update && source /etc/profile thing, but it still uses icedtea. Java-config reports that sun-jdk is in fact selected.

I recompiled javacc and ant but as you can see, I still get this error. How do I fix this?

Thanks.

EDIT: Forgot to mention, that I do have python 2.6.x installed:
[ebuild R ] dev-lang/python-2.6.4-r1

So no Python 3 related messes.
_________________
Nothing to read in this sig. Move along.


Last edited by StifflerStealth on Fri Mar 19, 2010 3:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Thu Mar 18, 2010 4:07 pm    Post subject: Reply with quote

to fix the generics errors change the depends in the ebuild. see:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/lucene/lucene-2.4.1.ebuild?rev=1.5&view=markup

there are two entries of
Quote:
>=virtual/jdk-1.4

change them into
Quote:
>=virtual/jdk-1.5

_________________
hear hear
Back to top
View user's profile Send private message
maevil
n00b
n00b


Joined: 24 Aug 2007
Posts: 64
Location: venezia

PostPosted: Thu Mar 18, 2010 7:00 pm    Post subject: Reply with quote

I had the same issue, changing those lines solved it :)
Thanks for tip!
Back to top
View user's profile Send private message
StifflerStealth
Retired Dev
Retired Dev


Joined: 03 Jul 2002
Posts: 968

PostPosted: Fri Mar 19, 2010 3:03 pm    Post subject: Reply with quote

geki wrote:
to fix the generics errors change the depends in the ebuild. see:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/lucene/lucene-2.4.1.ebuild?rev=1.5&view=markup

there are two entries of
Quote:
>=virtual/jdk-1.4

change them into
Quote:
>=virtual/jdk-1.5
Thanks geki. That worked perfectly. Now the ebuild in portage needs to be changed.
_________________
Nothing to read in this sig. Move along.
Back to top
View user's profile Send private message
alistair
Retired Dev
Retired Dev


Joined: 15 Jul 2005
Posts: 869

PostPosted: Sun Mar 21, 2010 9:18 am    Post subject: Reply with quote

StifflerStealth wrote:
geki wrote:
to fix the generics errors change the depends in the ebuild. see:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-java/lucene/lucene-2.4.1.ebuild?rev=1.5&view=markup

there are two entries of
Quote:
>=virtual/jdk-1.4

change them into
Quote:
>=virtual/jdk-1.5
Thanks geki. That worked perfectly. Now the ebuild in portage needs to be changed.


No not perfectly, it has covered the symptom without fixing the cause (being javacc). it could even lead to worse issues.
_________________
______________
Help the gentoo-java project. Visit Gentoo Java Project

what good are admin powers if you don't abuse them for personal gain - mark_alec
Back to top
View user's profile Send private message
geki
Advocate
Advocate


Joined: 13 May 2004
Posts: 2387
Location: Germania

PostPosted: Sun Mar 21, 2010 10:02 am    Post subject: Reply with quote

so, how to fix the cause? :o
where does the generics code come from?

I see javacc depends on 1.4. hmm ...
_________________
hear hear
Back to top
View user's profile Send private message
alistair
Retired Dev
Retired Dev


Joined: 15 Jul 2005
Posts: 869

PostPosted: Sun Mar 21, 2010 10:16 am    Post subject: Reply with quote

geki wrote:
so, how to fix the cause? :o
where does the generics code come from?

I see javacc depends on 1.4. hmm ...


javacc has a JDK_VERSION (or similar) property that influences code compatibility ( aka its like the -source option to javac, but is really the target of javacc).

javacc-5.0 is the first version (I believe) to have set this to default to 5/1.5.

So the real solution is to patch the build.xml file to pass this property.
_________________
______________
Help the gentoo-java project. Visit Gentoo Java Project

what good are admin powers if you don't abuse them for personal gain - mark_alec
Back to top
View user's profile Send private message
StifflerStealth
Retired Dev
Retired Dev


Joined: 03 Jul 2002
Posts: 968

PostPosted: Sun Mar 21, 2010 11:18 am    Post subject: Reply with quote

I'll leave that to the Java herd to fix then. :) I'm just beginning in Java, so I don't know how to fix it by patching the build.xml file.

Thanks for your quick replies everyone.
_________________
Nothing to read in this sig. Move along.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum