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.
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?
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 :)
(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"
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.
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.
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!
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
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.
1.5 JDKs are cheap today, so no reason to fix this :)