Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
More Java 1.5 (or 5 if you prefer) pain
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
db_404
Guru
Guru


Joined: 05 Dec 2002
Posts: 336

PostPosted: Fri Jun 10, 2005 6:25 pm    Post subject: More Java 1.5 (or 5 if you prefer) pain Reply with quote

I Often get things like
Code:

compile:
    [mkdir] Created dir: /var/tmp/portage/avalon-logkit-1.2/work/LogKit-1.2/buil                                                   d
    [mkdir] Created dir: /var/tmp/portage/avalon-logkit-1.2/work/LogKit-1.2/buil                                                   d/classes
    [javac] Compiling 69 source files to /var/tmp/portage/avalon-logkit-1.2/work                                                   /LogKit-1.2/build/classes
    [javac] javac: target release 1.2 conflicts with default source release 1.5

BUILD FAILED
/var/tmp/portage/avalon-logkit-1.2/work/LogKit-1.2/build.xml:331: Compile failed                                                   ; see the compiler error output for details.

Total time: 5 seconds

!!! ERROR: dev-java/avalon-logkit-1.2 failed.
!!! Function src_compile, Line 65, Exitcode 1
!!! Compilation failed
!!! If you need support, post the topmost build error, NOT this status message.


From builds as I am using Java 1.5 - is there ANYTHING that I can do about this (on a consistant basis), other than backing off the Java version - which isn't really an option as then you have 1.5->other version incompatibility pains, as a lot of my system is compiled with 1.5.

Also is this something that portage could handle automagically? - as often I've fixed these errors by editing the build.xml files to set 'target' and 'source'.
Back to top
View user's profile Send private message
kustos
Apprentice
Apprentice


Joined: 10 Sep 2003
Posts: 168

PostPosted: Fri Jun 10, 2005 7:43 pm    Post subject: Re: More Java 1.5 (or 5 if you prefer) pain Reply with quote

db_404 wrote:

Also is this something that portage could handle automagically? - as often I've fixed these errors by editing the build.xml files to set 'target' and 'source'.

Congrats, you understood the problem and the solution. Maybe this helps:
https://forums.gentoo.org/viewtopic-t-317253.html

Rumors are they are working on a special ant target that lets you specify `source' und `target' via java-config. Considering what has happended in the last year, I don't expect this anytime soon.
Back to top
View user's profile Send private message
db_404
Guru
Guru


Joined: 05 Dec 2002
Posts: 336

PostPosted: Sat Jun 11, 2005 1:06 am    Post subject: Reply with quote

An ant task seems like a reasonable way of tackling the problem - conceptually you could subclass the javac task and force set the source and target from settings in java-config. That way it would simply be a textual replace of javac with gentoo-javac or whatever in the build files.

Your XSLT aproach has the advantage of being somewhat simpler and a little less invasive.

But something really needs to be done - gentoo is a great server platform, but if you are going to have trouble running some of the newer Java code people will pass over it as a distribution.
Back to top
View user's profile Send private message
robbyjo
Guru
Guru


Joined: 06 Apr 2003
Posts: 462

PostPosted: Sat Jun 11, 2005 1:46 am    Post subject: Reply with quote

Ant already support -source and -target. See here:
http://ant.apache.org/manual/CoreTasks/javac.html
Back to top
View user's profile Send private message
db_404
Guru
Guru


Joined: 05 Dec 2002
Posts: 336

PostPosted: Sat Jun 11, 2005 4:38 pm    Post subject: Reply with quote

Yes - but normally the build files that gentoo is building from either do not use it, or use only source - which breaks things under 1.5. The gentoo maintainers can't be expected to manually edit all the build files for java packages in the tree, so as an alternative you make a gentoo specific task that handles setting the source & target attributes + also integrates with java-config.

At least I assume that was the idea.
Back to top
View user's profile Send private message
robbyjo
Guru
Guru


Joined: 06 Apr 2003
Posts: 462

PostPosted: Sat Jun 11, 2005 6:34 pm    Post subject: Reply with quote

True. But someone ought to post a patch or something. It should be a trivial patch.
Back to top
View user's profile Send private message
kustos
Apprentice
Apprentice


Joined: 10 Sep 2003
Posts: 168

PostPosted: Sat Jun 11, 2005 11:31 pm    Post subject: Reply with quote

robbyjo wrote:
True. But someone ought to post a patch or something. It should be a trivial patch.

No, such a patch would be huge, affecting possibly every java ebuild. But a script that does this, would be quite simple. Like my XSLT stylesheet for example.
Back to top
View user's profile Send private message
herberteuler
n00b
n00b


Joined: 02 Apr 2005
Posts: 33

PostPosted: Sun Jun 12, 2005 2:23 am    Post subject: Reply with quote

For me, Java 1.5 sdk from Sun is weak. I can't compile a CORBA program which is passed in jdk 1.4. I don't know what about other things in this version.

Regards,
herberteuler
Back to top
View user's profile Send private message
robbyjo
Guru
Guru


Joined: 06 Apr 2003
Posts: 462

PostPosted: Sun Jun 12, 2005 11:54 am    Post subject: Reply with quote

kustos wrote:
robbyjo wrote:
True. But someone ought to post a patch or something. It should be a trivial patch.

No, such a patch would be huge, affecting possibly every java ebuild. But a script that does this, would be quite simple. Like my XSLT stylesheet for example.


Well, trivialities lie on the simplicity of the patch. Someone could come up with a Perl script that modify javac ant tag and it should be easy enough.
Back to top
View user's profile Send private message
kustos
Apprentice
Apprentice


Joined: 10 Sep 2003
Posts: 168

PostPosted: Sun Jun 12, 2005 8:46 pm    Post subject: Reply with quote

robbyjo wrote:

Someone could come up with a Perl script that modify javac ant tag and it should be easy enough.

I don't see why perl should be better for XML-processing than XSLT. But even if it was, a script still is no patch.
Back to top
View user's profile Send private message
bll0
Apprentice
Apprentice


Joined: 22 May 2004
Posts: 178

PostPosted: Mon Jun 13, 2005 12:35 pm    Post subject: Reply with quote

herberteuler wrote:
For me, Java 1.5 sdk from Sun is weak. I can't compile a CORBA program which is passed in jdk 1.4. I don't know what about other things in this version.


I am using Sun JDK 1.4.2 for root and for my standard user 1.5. This helps when emerge breaks, but I can still use and develop with 1.5 in my normal environment. Until know I didn't discover any problems with applications built with 1.4 and running with 1.5

Maybe this might help you?
_________________
I need a girl whose name doesn't end in .jpg
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