Summary: | dev-java/xalan-2.6.0 doesn't compile with JDK 1.4 or 1.5 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Forza <forza> |
Component: | Current packages | Assignee: | Gentoo Linux bug wranglers <bug-wranglers> |
Status: | RESOLVED INVALID | ||
Severity: | blocker | CC: | fordfrog, ikelos, java, patrizio.bassi, vyzivus, wiktorw |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
JAXP API obviously containing older version of javax.transform package.
DOM Level 2 implementation patch to fix build.xml to explicitly specify the source and target for javac |
Description
Forza
2004-10-12 10:10:23 UTC
you compiled things with 1.5, now those things won't work with 1.4, and some things don't compile with 1.5, you used package.unmask and successfully shot yourself in the food I am not sure I understand. I haven't unmasked or added ~x86 keyword to xalan. Only to jdk 1.5.0 which I wanted to test to see if this was the problem. I have installed sun-jdk-1.5.0 (OK, IT IS ~AMD64, just listen a bit more :-) and when I tried to compile Xalan 2.6.0 *today* (nov 19th, 2004) it failed with an error that target 1.1 is not source-compatible with 1.5. This can be resolved by modifying build.xml file: 1) add the attribute source='1.3' to element 'javac' at line 266 (255? I don't remember :). However this opens a new bug: Xalan 2.6.0 is compatible ONLY with DOM Level 2, whereas Java 5.0 introduces DOM Level 3 library. 2) This *could* be resolved by downloading DOM Level 2 jar and modifying element baselibraries (or like that, just below the javac element) to a value like: "../path/to/dom.jar:xalan.base.libraries". I'm going to investigate more to this issue. I suggest that the bug is reopened because it seems that the bug is not ~-related. Created attachment 44285 [details]
JAXP API obviously containing older version of javax.transform package.
Created attachment 44286 [details]
DOM Level 2 implementation
Java 5.0 introduces DOM Level 3 and Xalan does not like that. DOM Level 2 is
required to compile Xalan.
I finally made it to emerge Xalan on Java 1.5, yahooo :). I had no problems with the "Unsupported major. minor version 49.0" bug at all, and I have resolved all bugs that I encountered. Here is what I did: 1) /var/tmp/portage/xalan-2.6.0/work/xalan-j_2_6_0/build.xml:256 add attribute source="1.3" to the javac element. This forces the compiler to be source-compatible with java 1.3 (assert is not a keyword, etc). 2) :187 JAVA 1.5 ONLY, I GUESS insert elements <pathelement path="/home/vyzivus/jwsdp-1.4/jaxp/lib/endorsed/dom.jar"/> <pathelement path="/home/vyzivus/jwsdp-1.4/jaxp/lib/jaxp-api.jar"/> before the element that is already on that line. I am posting those two JARs as attachments. dom.jar is DOM Level 2 jar file, and jaxp-api.jar contains older version of javax.transform package. Both are taken from JWSDP-1.4, that is freely available at SUN pages. This may be a problem because of SUN's license - you must agree to some license before downloading JWSDP. The license appears to be the same license as the sun-jdk-1.5.0 license. Interesting is that these two libs seems NOT required for running xalan :-) 3) :291 add attribute source="1.3" to the javac element 4) why not add this script /usr/bin/xalan containing only a single line java -jar /usr/share/xalan/lib/xalan.jar $* the script would allow us to use xalan in shell. I have resolved the issue hence I *strongly* encourage to reopen the bug. Thanx Created attachment 45550 [details, diff]
patch to fix build.xml to explicitly specify the source and target for javac
The attached patch modifies the build.xml by adding a javac.target propery
which defaults to 1.3 and forces all javac targets to use it. The code compiles
with jdk1.5 also if the target is 1.4 or 1.5 but I think for now it's enough
that the target is something that can be used with multiple jdk version. In the
future we could modify the target to depend on the jdk used.
I would also strongly like to ask someone to reopen this bug as the current
ebuild does not build at least with amd64/jdk1.5.0.
To use the patch this must be added to the ebuild:
src_unpack() {
unpack ${A}
cd ${S}
epatch ${FILESDIR}/xalan-jdk15.patch
}
The above patch works also with xalan-2.6.0-r1, just add the epatch line after the cd ${S} line in the src_unpack() function. I'd like to ask why the bug is marked as invalid? The bug is real - try to emerge xalan on jdk15, and the bug seems to have been fixed. Is the fix in portage yet? Yes, The patch seem to work. At least it could be uncluded in portage but be masked by ~arch or something like that for now? The patch works for xalan-2.6.0-r2. I suggest to apply the patch when compiling xalan on java version 5.0. *** Bug 90699 has been marked as a duplicate of this bug. *** patch works perfectly. please apply to portage tree I was able to get this to build with jdk 1.5 using the patch attached above. I copied the 2.6.0-r2 ebuild, and made a new one. I had to add epatch ${FILESDIR}/xalan-jdk15.patch to the end of src_unpack (as mentioned above), but I also had to remove the goofy rm -f *.jar from line 34 of the ebuild, since that was deleting the jars that the patch tries to use. I second the previous posts. I was able to compile xalan-2.6.0-r2 just fine under sun-jdk-1.5.0 using the patch from comment #7, so the solution mentioned in comment #14 should lead to the improved ebuild xalan-2.6.0-r3. Please reconsider creating a new ebuild. Everything what's needed is already in this bug report! the patch fixed it for me too ... pls add to curent tree! Hi, I also got errors compiling xalan-2.6.0-r2 on my AMD64. Here are the errors : [javac] WARNING [javac] The -source switch defaults to 1.5 in JDK 1.5. [javac] If you specify -target 1.1 you now must also specify -source 1.2. [javac] Ant will implicitly add -source 1.2 for you. Please change your build file. [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/utils/XMLString.java:610: warning: unmappable character for encoding UTF8 [javac] * "Fahrvergn�gen".toUpperCase() returns "FAHRVERGN�GEN" [javac] ^ [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/utils/XMLString.java:610: warning: unmappable character for encoding UTF8 [javac] * "Fahrvergn�gen".toUpperCase() returns "FAHRVERGN�GEN" [javac] ^ [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/utils/XMLStringDefault.java:716: warning: unmappable character for encoding UTF8 [javac] * "Fahrvergn�gen".toUpperCase() returns "FAHRVERGN�GEN" [javac] ^ [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/utils/XMLStringDefault.java:716: warning: unmappable character for encoding UTF8 [javac] * "Fahrvergn�gen".toUpperCase() returns "FAHRVERGN�GEN" [javac] ^ [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/dtm/ref/DTMNodeProxy.java:54: org.apache.xml.dtm.ref.DTMNodeProxy is not abstract and does not override abstract method getUserData(java.lang.String) in org.w3c.dom.Node [javac] public class DTMNodeProxy [javac] ^ [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/dtm/ref/DTMNodeProxy.java:1327: org.apache.xml.dtm.ref.DTMNodeProxy.DTMNodeProxyImplementation is not abstract and does not override abstract method getFeature(java.lang.String,java.lang.String) in org.w3c.dom.DOMImplementation [javac] static class DTMNodeProxyImplementation implements DOMImplementation [javac] ^ [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java:48: org.apache.xml.dtm.ref.dom2dtm.DOM2DTMdefaultNamespaceDeclarationNode is not abstract and does not override abstract method isId() in org.w3c.dom.Attr [javac] public class DOM2DTMdefaultNamespaceDeclarationNode implements Attr [javac] ^ [javac] /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/src/org/apache/xml/utils/UnImplNode.java:44: org.apache.xml.utils.UnImplNode is not abstract and does not override abstract method getUserData(java.lang.String) in org.w3c.dom.Node [javac] public class UnImplNode implements Node, Element, NodeList, Document [javac] ^ [javac] Note: * uses or overrides a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] 4 errors [javac] 4 warnings BUILD FAILED /var/tmp/portage/xalan-2.6.0-r2/work/xalan-j_2_6_0/build.xml:256: Compile failed; see the compiler error output for details. I solved the problem using the patch for the build.xml, and modifying the src_unpack section of the ebuild : src_unpack() { unpack ${A} cd ${S}/bin rm -f *.jar java-pkg_jar-from xerces-2 java-pkg_jar-from javacup javacup.jar java_cup.jar java-pkg_jar-from javacup javacup.jar runtime.jar java-pkg_jar-from bcel bcel.jar BCEL.jar java-pkg_jar-from jakarta-regexp-1.3 jakarta-regexp.jar regexp.jar java-pkg_jar-from bsf-2.3 #java-pkg_jar-from jtidy #java-pkg_jar-from jlex jlex.jar JLex.jar # >>>>>>>>> START OF ADDED LINES <<<<<<<<<<<< cd ${S} epatch ${FILESDIR}/xalan-jdk15.patch # >>>>>>>>> END OF ADDED LINES <<<<<<<<<<<< } Hope that help someone else... Oh, btw, I don't know how to solve those UTF8 Warnings... Any ideas are welcome ;-) Tristan. *** Bug 111699 has been marked as a duplicate of this bug. *** -r3 fails too, why not applying this patch? it works perfectly, with jikes too :) jdk 1.5 portage is around...so i see no problems. *** Bug 114879 has been marked as a duplicate of this bug. *** I have tried xalan-2.7.0 and it compiles without problems. I've just copied xalan-2.6.0-r3.ebuild and removed reference to xalan-2.7.0-docs.tar.bz2 file because I didn't find the file at their website. |