Re: ant with jdk5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I tested all Ant jars and here (F13 x86_64) all classes are version 46.0 (Java 1.2)

Then I enabled exec_debug on /usr/bin/ant to get the ant invocation classpath, which is:

$ ant -diagnostics
exec "/usr/lib/jvm/java/bin/java" -classpath
"/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/antlr.jar:/usr/share/java/ant/ant-antlr.jar:/usr/share/java/bcel.jar:/usr/share/java/ant/ant-apache-bcel.jar:/usr/share/java/bsf.jar:/usr/share/java/ant/ant-apache-bsf.jar:/usr/share/java/log4j.jar:/usr/share/java/ant/ant-apache-log4j.jar:/usr/share/java/oro.jar:/usr/share/java/ant/ant-apache-oro.jar:/usr/share/java/regexp.jar:/usr/share/java/ant/ant-apache-regexp.jar:/usr/share/java/xml-commons-resolver.jar:/usr/share/java/ant/ant-apache-resolver.jar:/usr/share/java/jakarta-commons-logging.jar:/usr/share/java/ant/ant-commons-logging.jar:/usr/share/java/jakarta-commons-net.jar:/usr/share/java/ant/ant-commons-net.jar:/usr/share/java/javamail.jar:/usr/share/java/jaf.jar:/usr/share/java/ant/ant-javamail.jar:/usr/share/java/jdepend.jar:/usr/share/java/ant/ant-jdepend.jar:/usr/share/java/jsch.jar:/usr/share/java/ant/ant-jsch.jar:/usr/s
 hare/java/junit.jar:/usr/share/j
ava/ant/ant-junit.jar:/usr/share/java/ant/ant-nodeps.jar:/usr/share/java/ant/ant-swing.jar:/usr/share/java/jaxp_transform_impl.jar:/usr/share/java/ant/ant-trax.jar:/usr/share/java/xalan-j2-serializer.jar:/usr/lib/jvm/java/lib/tools.jar"
-Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib"
org.apache.tools.ant.launch.Launcher -cp "" "-diagnostics"

And tested all classes on every jar outside /usr/share/ant (which I had already tested). Here's the
results:

/usr/share/java/jaxp_parser_impl.jar             compiled Java class data, version 50.0 (Java 1.6)
/usr/share/java/xml-commons-apis.jar            compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/antlr.jar                       compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/bcel.jar                        compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/bsf.jar                         compiled Java class data, version 48.0 (Java 1.4)
/usr/share/java/log4j.jar                       compiled Java class data, version 45.3
/usr/share/java/oro.jar                         compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/regexp.jar                      compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/xml-commons-resolver.jar        compiled Java class data, version 48.0 (Java 1.4)
/usr/share/java/jakarta-commons-logging.jar     compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/jakarta-commons-net.jar         compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/javamail.jar                    compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/jaf.jar                         compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/jdepend.jar                     compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/jsch.jar                        compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/junit.jar                       compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/jaxp_transform_impl.jar         compiled Java class data, version 49.0 (Java 1.5)
/usr/share/java/xalan-j2-serializer.jar         compiled Java class data, version 49.0 (Java 1.5)

So it looks the problem is with jaxp_parser_impl.jar which was compiled using 1.6 as target. I see
it comes from:

$ rpm -q --whatprovides /usr/share/java/jaxp_parser_impl.jar
xerces-j2-2.9.0-3.fc13.noarc

But from Apache Xerces J2 web site:
http://xerces.apache.org/xerces2-j/faq-general.html#faq-11
"What JDK level is required for Xerces?	
As of version 2.6.2, Xerces requires JDK 1.2 or later to run and also requires JDK 1.2 or later to
build the source code."

Questions:
- What is class data version 45.3 (from log4j.jar)?
- How to install (from Fedora or JPackage repos) an jaxp_parser_impl.jar / Xerces J2 complied for
JDK 5?
- How it be that ant runs fine using gij which in theory supports only Java 5?


[]s, Fernando Lozano


> Hi,
> 
> I'm using Fedora 13 x86_64, not 12. On Fedora 11 there where no problems, but I skipped F12.
> 
> It looks like something related to XML parser, see the output of ant -diagnostics.
> 
> ------- Ant diagnostics report -------
> Apache Ant version 1.7.1 compiled on April 16 2010
> 
> -------------------------------------------
>  Implementation Version
> -------------------------------------------
> core tasks     : 1.7.1
> optional tasks : not available
> 
> -------------------------------------------
>  ANT PROPERTIES
> -------------------------------------------
> ant.version: Apache Ant version 1.7.1 compiled on April 16 2010
> ant.java.version: 1.5
> ant.core.lib: /usr/share/java/ant-1.7.1.jar
> ant.home: /usr/share/ant
> 
> -------------------------------------------
>  ANT_HOME/lib jar listing
> -------------------------------------------
> ant.home: /usr/share/ant
> ant-commons-logging.jar (4031 bytes)
> ant-javamail.jar (7163 bytes)
> ant-nodeps.jar (438618 bytes)
> ant-launcher.jar (12243 bytes)
> ant-swing.jar (6772 bytes)
> ant-bootstrap.jar (19013 bytes)
> ant-jdepend.jar (8307 bytes)
> ant-junit.jar (94995 bytes)
> ant-apache-regexp.jar (3772 bytes)
> ant-apache-log4j.jar (3042 bytes)
> ant-trax.jar (6927 bytes)
> ant.jar (1339582 bytes)
> ant-apache-bsf.jar (4021 bytes)
> ant-commons-net.jar (47981 bytes)
> ant-apache-oro.jar (40216 bytes)
> ant-apache-bcel.jar (8796 bytes)
> ant-antlr.jar (5927 bytes)
> ant-apache-resolver.jar (4060 bytes)
> ant-jsch.jar (31458 bytes)
> 
> -------------------------------------------
>  USER_HOME/.ant/lib jar listing
> -------------------------------------------
> user.home: /home/lozano
> No such directory.
> 
> -------------------------------------------
>  Tasks availability
> -------------------------------------------
> image : Not Available (the implementation class is not present)
> wlrun : Not Available (the implementation class is not present)
> stlist : Not Available (the implementation class is not present)
> netrexxc : Not Available (the implementation class is not present)
> starteam : Not Available (the implementation class is not present)
> stylebook : Not Available (the implementation class is not present)
> stlabel : Not Available (the implementation class is not present)
> stcheckin : Not Available (the implementation class is not present)
> stcheckout : Not Available (the implementation class is not present)
> ejbc : Not Available (the implementation class is not present)
> wlstop : Not Available (the implementation class is not present)
> sound : Not Available (the implementation class is not present)
> ddcreator : Not Available (the implementation class is not present)
> A task being missing/unavailable should only matter if you are trying to use it
> 
> -------------------------------------------
>  org.apache.env.Which diagnostics
> -------------------------------------------
> Not available.
> Download it at http://xml.apache.org/commons/
> 
> -------------------------------------------
>  XML Parser information
> -------------------------------------------
> Bad version number in .class file
> 
> 
> 
> > Hi,
> > 
> > > $ ant -v
> > > Apache Ant version 1.7.1 compiled on April 16 2010
> > > Buildfile: build.xml
> > > Detected Java version: 1.5 in: /usr/lib/jvm/java-1.5.0-sun-1.5.0.22/jre
> > > Detected OS: Linux
> > > 
> > > BUILD FAILED
> > > java.lang.UnsupportedClassVersionError: Bad version number in .class file
> > 
> > On Fedora 12 x86_64 with OpenJDK I get:
> > 
> > $ ant -v
> > Apache Ant version 1.7.1 compiled on August 13 2009
> > Buildfile: build.xml does not exist!
> > Build failed
> > 
> > and looking in ant.jar, I see, for example:
> > 
> > $ file org/apache/tools/ant/BuildEvent.class 
> > org/apache/tools/ant/BuildEvent.class: compiled Java class data, version 46.0 (Java 1.2)
> > 
> > so it doesn't look like the bytecode is too new.  I suggest trying to
> > get more information which class is causing the
> > UnsupportedClassVersionError and/or looking at all .class files in
> > /usr/share/java/ant.jar (and/or the other ant JARs).
> > 
> > Andrew
> > -- 
> > users mailing list
> > users@xxxxxxxxxxxxxxxxxxxxxxx
> > To unsubscribe or change subscription options:
> > https://admin.fedoraproject.org/mailman/listinfo/users
> > Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> -- 
> users mailing list
> users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux