Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 157488 - dev-java/sun-javamail could have jdk-1.4 as dependency instead of jdk-1.5, with java5 useflag
Summary: dev-java/sun-javamail could have jdk-1.4 as dependency instead of jdk-1.5, wi...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Other
: High normal
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-07 21:21 UTC by Eric Maziade
Modified: 2007-04-27 23:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Maziade 2006-12-07 21:21:09 UTC
dev-java/sun-javamail has jdk-1.5 in his dependencies.

According to sun's documentation, javamail needs jdk 1.4 or higher.

In our particular case, we have some java code from jdk/jre1.4 not running properly under jdk1.5.  We need to stick to 1.4 until everything has been tested out properly for an upgrade.
Comment 1 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-08 05:21:33 UTC
sun-javamail source contains one class (something with IMAP I think) which imports javax.security.sasl, which is not present on jdk 1.4, only in jdk 1.5 and higher. So we cannot compile it fully with jdk 1.4. But we still set the bytecode to 1.4, so the resulting .jar is usable with 1.4 jdk/jre as long as you don't try to use the IMAP thing (which is exactly the same as the compiled .jar provided by sun)

So, the fact we are building it with 1.5 shouldn't affect the usage of resulting .jar with 1.4 and you shouldn't have any problem. Or am I mistaken?
Comment 2 Eric Maziade 2006-12-08 05:45:43 UTC
I believe you are right.  However, I cannot emerge sun-javamail 'as-is' when I mask jdk-1.5.

I support I should bypass this by using sun-javamail-bin instead (which is what we did on the production server).

I modified my local copy of tge sun-javamail's eBuild to depend in 1.4 instead.  It seemed to have compiled properly... I might've missed the error in the output.

Perhaps there would be a way to work a switch in there to use 1.4 and skip the other class.  Or maybe just a note to use the -bin version instead.  

Or maybe we're the only ones not ready to move to 1.5 :)
Comment 3 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-08 06:03:14 UTC
(In reply to comment #2)
> I modified my local copy of tge sun-javamail's eBuild to depend in 1.4 instead.
>  It seemed to have compiled properly... I might've missed the error in the
> output.

You can't really miss it, because emerge dies there :)

    [javac] 1. ERROR in /var/tmp/portage/dev-java/sun-javamail-1.4/work/mail/src/java/com/sun/mail/imap/protocol/IMAPSaslAuthenticator.java
    [javac]  (at line 32)
    [javac]     import javax.security.sasl.*;
    [javac]            ^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.security.sasl cannot be resolved

!!! eant failed
!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! When you file a bug report, please include the following information:
GENTOO_VM=sun-jdk-1.4  CLASSPATH="" JAVA_HOME="/opt/sun-jdk-1.4.2.13"
Comment 4 Eric Maziade 2006-12-08 07:16:53 UTC
lol!  I wonder how I missed *that* !  (shame on me!!)

Guess we'll stick to the binaries until we're ready to move to 1.5, then.
Comment 5 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-12-08 08:21:37 UTC
BTW, having 1.5 JDK installed just for emerges that need it won't affect your app, you can still use it with 1.4 JDK (adjust user/system VM to 1.4 etc). So no reason to mask it.

I'll leave this open for consideration if we want a java5 useflag for sun-javamail which would (if disabled) use 1.4 JDK and just delete the offending source file. In the end, having a class that depends on 1.5 JDK running with 1.4 JRE, is the same as not having the class at all.

Also, I think there's some problem with our eclasses. This is javamail's package.env:

DESCRIPTION="A Java-based framework to build multiplatform mail and messaging applications."
GENERATION="2"
CLASSPATH="/usr/share/sun-javamail/lib/mail.jar"
DEPEND="activation.jar@sun-jaf"
VM=">=virtual/jre-1.4"
TARGET="1.5"
SOURCE="1.4"
MERGE_VM="sun-jdk-1.7"
MERGE_COMPILER="ecj-3.2"

The TARGET="1.5" part is bogus, ebuild explicitly asks for 1.4 and bytecode is also 1.4.
Comment 6 Eric Maziade 2006-12-08 09:26:52 UTC
I wasn't aware that emerge could allow me to have 1.4 and 1.5 installed at the same time.

I'll have to check into that.  Thanks!
Comment 7 William L. Thomson Jr. (RETIRED) gentoo-dev 2006-12-08 11:57:24 UTC
Noise was made in as many places as possible for a few months. But the entire Gentoo java system was upgraded some time back. I assume you performed the upgrade but might have missed the reasoning. I would recommend reviewing the following document.

http://www.gentoo.org/proj/en/java/java-upgrade.xml
Comment 8 Eric Maziade 2006-12-08 13:05:38 UTC
You're absolutely right.  Looks like I brainlessly followed upgrade instructions.

The link you provided makes the new config clear.  Very nice.

I'll test my setup out (without the masking) and hope to move it to production soon.  Thanks.
Comment 9 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2007-04-27 23:03:04 UTC
1.5 JDKs are cheap today, so no reason to fix this :)