You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jdeisenberg <ca...@catcode.com> on 2009/08/11 14:47:51 UTC

XML Parser give "bad version number in .class file"

Using Java 1.5 (and also have tried Java 1.6) on Mandriva Spring 2008.

When trying to build an android app using
   ant -debug

I get this output:
=============================================
java.lang.UnsupportedClassVersionError: Bad version number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at
javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:88)
        at
javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:278)
        at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
        at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:107)
        at
org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:120)
        at
org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:104)
        at
org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:172)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:185)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:138)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:96)
        at org.apache.tools.ant.Main.runBuild(Main.java:683)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Bad version number in .class file
================================
Running the following command:

  ant -diagnostics

gives this output (I have decided to err on the side of caution by including
all output)
================================================
------- Ant diagnostics report -------
Apache Ant version 1.7.0 compiled on January 10 2008

-------------------------------------------
 Implementation Version
-------------------------------------------
core tasks     : 1.7.0
optional tasks : not available

-------------------------------------------
 ANT PROPERTIES
-------------------------------------------
ant.version: Apache Ant version 1.7.0 compiled on January 10 2008
ant.java.version: 1.5
ant.core.lib: /usr/share/java/ant-1.7.0.jar
ant.home: /usr/share/ant

-------------------------------------------
 ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant

-------------------------------------------
 USER_HOME/.ant/lib jar listing
-------------------------------------------
user.home: /home/david
No such directory.

-------------------------------------------
 Tasks availability
-------------------------------------------
propertyfile : Not Available (the implementation class is not present)
ccmkdir : Not Available (the implementation class is not present)
importtypelib : Not Available (the implementation class is not present)
vsscheckin : Not Available (the implementation class is not present)
p4reopen : Not Available (the implementation class is not present)
image : Not Available (the implementation class is not present)
csc : Not Available (the implementation class is not present)
sshexec : Not Available (the implementation class is not present)
wlrun : Not Available (the implementation class is not present)
p4label : Not Available (the implementation class is not present)
p4revert : Not Available (the implementation class is not present)
replaceregexp : Not Available (the implementation class is not present)
jjtree : Not Available (the implementation class is not present)
jarlib-display : Not Available (the implementation class is not present)
jspc : Not Available (the implementation class is not present)
vsshistory : Not Available (the implementation class is not present)
p4submit : Not Available (the implementation class is not present)
scp : Not Available (the implementation class is not present)
ccmcheckin : Not Available (the implementation class is not present)
p4change : Not Available (the implementation class is not present)
p4delete : Not Available (the implementation class is not present)
vssadd : Not Available (the implementation class is not present)
p4integrate : Not Available (the implementation class is not present)
translate : Not Available (the implementation class is not present)
cclock : Not Available (the implementation class is not present)
chown : Not Available (the implementation class is not present)
jarlib-available : Not Available (the implementation class is not present)
rexec : Not Available (the implementation class is not present)
WsdlToDotnet : Not Available (the implementation class is not present)
ejbjar : Not Available (the implementation class is not present)
stlist : Not Available (the implementation class is not present)
serverdeploy : Not Available (the implementation class is not present)
ildasm : Not Available (the implementation class is not present)
schemavalidate : Not Available (the implementation class is not present)
cccheckin : Not Available (the implementation class is not present)
ccunlock : Not Available (the implementation class is not present)
wljspc : Not Available (the implementation class is not present)
telnet : Not Available (the implementation class is not present)
sosget : Not Available (the implementation class is not present)
p4sync : Not Available (the implementation class is not present)
ccmklabel : Not Available (the implementation class is not present)
p4edit : Not Available (the implementation class is not present)
antlr : Not Available (the implementation class is not present)
netrexxc : Not Available (the implementation class is not present)
ftp : Not Available (the implementation class is not present)
ccmcheckout : Not Available (the implementation class is not present)
xmlvalidate : Not Available (the implementation class is not present)
p4resolve : Not Available (the implementation class is not present)
iplanet-ejbc : Not Available (the implementation class is not present)
ccmcheckintask : Not Available (the implementation class is not present)
native2ascii : Not Available (the implementation class is not present)
ccrmtype : Not Available (the implementation class is not present)
starteam : Not Available (the implementation class is not present)
vsscheckout : Not Available (the implementation class is not present)
mimemail : Not Available (the implementation class is not present)
stylebook : Not Available (the implementation class is not present)
soscheckin : Not Available (the implementation class is not present)
stlabel : Not Available (the implementation class is not present)
cab : Not Available (the implementation class is not present)
splash : Not Available (the implementation class is not present)
ccmkbl : Not Available (the implementation class is not present)
cccheckout : Not Available (the implementation class is not present)
p4have : Not Available (the implementation class is not present)
jdepend : Not Available (the implementation class is not present)
jsharpc : Not Available (the implementation class is not present)
symlink : Not Available (the implementation class is not present)
script : Not Available (the implementation class is not present)
ccmcreatetask : Not Available (the implementation class is not present)
rpm : Not Available (the implementation class is not present)
attrib : Not Available (the implementation class is not present)
echoproperties : Not Available (the implementation class is not present)
stcheckin : Not Available (the implementation class is not present)
chgrp : Not Available (the implementation class is not present)
stcheckout : Not Available (the implementation class is not present)
p4labelsync : Not Available (the implementation class is not present)
vsscreate : Not Available (the implementation class is not present)
ejbc : Not Available (the implementation class is not present)
vbc : Not Available (the implementation class is not present)
wsdltodotnet : Not Available (the implementation class is not present)
ccmkattr : Not Available (the implementation class is not present)
ccupdate : Not Available (the implementation class is not present)
renameext : Not Available (the implementation class is not present)
vsslabel : Not Available (the implementation class is not present)
vsscp : Not Available (the implementation class is not present)
p4fstat : Not Available (the implementation class is not present)
setproxy : Not Available (the implementation class is not present)
wlstop : Not Available (the implementation class is not present)
p4counter : Not Available (the implementation class is not present)
ilasm : Not Available (the implementation class is not present)
soscheckout : Not Available (the implementation class is not present)
ccuncheckout : Not Available (the implementation class is not present)
jarlib-resolve : Not Available (the implementation class is not present)
jlink : Not Available (the implementation class is not present)
javacc : Not Available (the implementation class is not present)
pvcs : Not Available (the implementation class is not present)
jarlib-manifest : Not Available (the implementation class is not present)
ccmklbtype : Not Available (the implementation class is not present)
sound : Not Available (the implementation class is not present)
scriptdef : Not Available (the implementation class is not present)
blgenclient : Not Available (the implementation class is not present)
jjdoc : Not Available (the implementation class is not present)
ccmkelem : Not Available (the implementation class is not present)
javah : Not Available (the implementation class is not present)
ccmreconfigure : Not Available (the implementation class is not present)
p4add : Not Available (the implementation class is not present)
soslabel : Not Available (the implementation class is not present)
depend : Not Available (the implementation class is not present)
vssget : 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
=================================

What am I doing wrong?



-- 
View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24916911.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class fi

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
I see your point...

when I run w/ diagnostics I see the following xml section:

-------------------------------------------
  XML Parser information
-------------------------------------------
XML Parser : org.apache.xerces.jaxp.SAXParserImpl
XML Parser Location: 
/home/sfloess/Tools/apache-ant-1.7.1/lib/xercesImpl.jar

Hmm - not sure now :(

On Tue, 11 Aug 2009, jdeisenberg wrote:

>
>
>
> Steve Loughran wrote:
>>
>> Scot P. Floess wrote:
>>>
>>> so unless you are setting any kind of factory for the xml parser, it
>>> should use the stock XML parser that comes with Java.
>>>
>>
>> ant -diagnostics finds the XML parser
>>
>>
>
> That's the problem. diagnostics ends with this
>    -------------------------------------------
>      XML Parser information
>    -------------------------------------------
>    Bad version number in .class file
>
> so it never tells me where it's looking!
>
>
>
>> Is there anything in your build.xml that is processing xml or you are
>> setting the xml factory (off the top of my head I can't remember the
>> factory name/property one sets to change the default)...
>>
>
> Not that I can see; it's the build file created by android. In any event,
> when I run diagnostics, it should not be looking for a build.xml file, and
> it still comes to a dead halt when trying to look for the XML parser. I
> checked this by running the command
>
>   ant -diagnostics
>
> from a directory that has no build.xml file at all, and it gave the same
> output as in the original post.
>
> Part of the build.xml file contains this:
>
>    <path id="android.antlibs">
>        <pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
>        <pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
>        <pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
>        <pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
>        <pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
>    </path>
>
>
>
> -- 
> View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24918193.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by jdeisenberg <ca...@catcode.com>.


Steve Loughran wrote:
> 
> 
> 
> 0. What is printed up to that point?
> 
> 1. what does java -version say
> 
> 2. what's in ANT_HOME/lib
> 

That was the problem. I installed the binary of the latest ant, and exported
ANT_HOME to point to that directory. It seems to be working now.


-- 
View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24928038.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by jdeisenberg <ca...@catcode.com>.


jdeisenberg wrote:
> 
> 
> Steve Loughran wrote:
>> Scot P. Floess wrote:
>>> so unless you are setting any kind of factory for the xml parser, it 
>>> should use the stock XML parser that comes with Java.
>>>
>> ant -diagnostics finds the XML parser
>>
>>
> 
> That's the problem. diagnostics ends with this
>     -------------------------------------------
>       XML Parser information
>     -------------------------------------------
>     Bad version number in .class file 



ooh. That's cute. I think Ant needs to handle that better.

0. What is printed up to that point?

See first post in the thread; I don't want to copy/paste that entire text.

1. what does java -version say

See  previous posts, but this is short enough to paste:

david@localhost java]$ java -version
java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Server VM (build 1.5.0_15-b04, mixed mode)


2. what's in ANT_HOME/lib

Nothing; there is no ANT_HOME defined

3. what's JAVA_HOME, and in JAVA_HOME/lib or $JAVA_HOME/jre/lib ?

[david@localhost java]$ echo $JAVA_HOME
/usr/lib/jvm/java
[david@localhost java]$ ls $JAVA_HOME/lib
dt.jar  htmlconverter.jar  ir.idl  jconsole.jar  orb.idl  sa-jdi.jar 
tools.jar
[david@localhost java]$ ls $JAVA_HOME/jre/lib
applet/                               fontconfig.Turbo.8.0.bfc
audio/                                fontconfig.Turbo.8.0.properties.src
charsets.jar                          fontconfig.Turbo.bfc
classlist                             fontconfig.Turbo.properties.src
cmm/                                  font.properties@
content-types.properties              fonts/
deploy/                               i386/
deploy.jar                            im/
endorsed/                             images/
ext/                                  java-1.5.0-sun-java.desktop
flavormap.properties                  javaws/
fontconfig.bfc                        javaws.jar
fontconfig.properties.src             jce.jar
fontconfig.RedHat.2.1.bfc             jsse.jar
fontconfig.RedHat.2.1.properties.src  jvm.hprof.txt
fontconfig.RedHat.3.bfc               locale/
fontconfig.RedHat.3.properties.src    logging.properties
fontconfig.RedHat.8.0.bfc             management/
fontconfig.RedHat.8.0.properties.src  net.properties
fontconfig.RedHat.9.0.bfc             oblique-fonts/
fontconfig.RedHat.9.0.properties.src  plugin.jar
fontconfig.RedHat.bfc                 psfontj2d.properties
fontconfig.RedHat.properties.src      psfont.properties.ja
fontconfig.Sun.2003.bfc               rt.jar
fontconfig.Sun.2003.properties.src    security/
fontconfig.Sun.bfc                    sharedmimeinfo
fontconfig.Sun.properties.src         sound.properties
fontconfig.SuSE.bfc                   tools.jar
fontconfig.SuSE.properties.src        zi/

-- 
View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24927958.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by Steve Loughran <st...@apache.org>.
jdeisenberg wrote:
> 
> 
> Steve Loughran wrote:
>> Scot P. Floess wrote:
>>> so unless you are setting any kind of factory for the xml parser, it 
>>> should use the stock XML parser that comes with Java.
>>>
>> ant -diagnostics finds the XML parser
>>
>>
> 
> That's the problem. diagnostics ends with this
>     -------------------------------------------
>       XML Parser information
>     -------------------------------------------
>     Bad version number in .class file 



ooh. That's cute. I think Ant needs to handle that better.

0. What is printed up to that point?

1. what does java -version say

2. what's in ANT_HOME/lib

3. what's JAVA_HOME, and in JAVA_HOME/lib or $JAVA_HOME/jre/lib ?





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by jdeisenberg <ca...@catcode.com>.


Steve Loughran wrote:
> 
> Scot P. Floess wrote:
>> 
>> so unless you are setting any kind of factory for the xml parser, it 
>> should use the stock XML parser that comes with Java.
>> 
> 
> ant -diagnostics finds the XML parser
> 
> 

That's the problem. diagnostics ends with this
    -------------------------------------------
      XML Parser information
    -------------------------------------------
    Bad version number in .class file 

so it never tells me where it's looking!



> Is there anything in your build.xml that is processing xml or you are
> setting the xml factory (off the top of my head I can't remember the
> factory name/property one sets to change the default)...
> 

Not that I can see; it's the build file created by android. In any event,
when I run diagnostics, it should not be looking for a build.xml file, and
it still comes to a dead halt when trying to look for the XML parser. I
checked this by running the command

   ant -diagnostics

from a directory that has no build.xml file at all, and it gave the same
output as in the original post.

Part of the build.xml file contains this:

    <path id="android.antlibs">
        <pathelement path="${sdk-location}/tools/lib/anttasks.jar" />
        <pathelement path="${sdk-location}/tools/lib/sdklib.jar" />
        <pathelement path="${sdk-location}/tools/lib/androidprefs.jar" />
        <pathelement path="${sdk-location}/tools/lib/apkbuilder.jar" />
        <pathelement path="${sdk-location}/tools/lib/jarutils.jar" />
    </path>



-- 
View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24918193.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by Steve Loughran <st...@apache.org>.
Scot P. Floess wrote:
> 
> so unless you are setting any kind of factory for the xml parser, it 
> should use the stock XML parser that comes with Java.
> 

ant -diagnostics finds the XML parser

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
so unless you are setting any kind of factory for the xml parser, it 
should use the stock XML parser that comes with Java.

Is there anything in your build.xml that is processing xml or you are 
setting the xml factory (off the top of my head I can't remember the 
factory name/property one sets to change the default)...

On Tue, 11 Aug 2009, jdeisenberg wrote:

>
>
>
> Scot P. Floess-2 wrote:
>>
>>
>> It almost looks like what ever version of the XML parser you are using was
>> compiled with a newer VM?
>>
>> [snip]
>>
>>
>
> I am not sure *where* to find the XML parser so that I might update it. What
> is ant's default classpath, or where should I look?
>
> -- 
> View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24917391.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by jdeisenberg <ca...@catcode.com>.


Scot P. Floess-2 wrote:
> 
> 
> It almost looks like what ever version of the XML parser you are using was 
> compiled with a newer VM?
> 
> [snip]
> 
> 

I am not sure *where* to find the XML parser so that I might update it. What
is ant's default classpath, or where should I look?

-- 
View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24917391.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
It almost looks like what ever version of the XML parser you are using was 
compiled with a newer VM?

On Tue, 11 Aug 2009, jdeisenberg wrote:

>
>
>
>
> Not that I doubt you ;)
>
> But from the command line, what do you get doing:
>
> java -version
>
> Just wanting to make sure you somehow don't have a JDK 1.4 or less...
>
> [snip old info]
>
> [david@localhost android_app]$ java -version
> java version "1.5.0_15"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
> Java HotSpot(TM) Server VM (build 1.5.0_15-b04, mixed mode)
>
> -- 
> View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24917058.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by jdeisenberg <ca...@catcode.com>.



Not that I doubt you ;)

But from the command line, what do you get doing:

java -version

Just wanting to make sure you somehow don't have a JDK 1.4 or less...

[snip old info]

[david@localhost android_app]$ java -version
java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Server VM (build 1.5.0_15-b04, mixed mode)

-- 
View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24917058.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: XML Parser give "bad version number in .class file"

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Not that I doubt you ;)

But from the command line, what do you get doing:

java -version

Just wanting to make sure you somehow don't have a JDK 1.4 or less...



On Tue, 11 Aug 2009, jdeisenberg wrote:

>
> Using Java 1.5 (and also have tried Java 1.6) on Mandriva Spring 2008.
>
> When trying to build an android app using
>   ant -debug
>
> I get this output:
> =============================================
> java.lang.UnsupportedClassVersionError: Bad version number in .class file
>        at java.lang.ClassLoader.defineClass1(Native Method)
>        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>        at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>        at
> javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:88)
>        at
> javax.xml.parsers.FactoryFinder.findJarServiceProvider(FactoryFinder.java:278)
>        at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:185)
>        at
> javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:107)
>        at
> org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:120)
>        at
> org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:104)
>        at
> org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:172)
>        at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:185)
>        at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:138)
>        at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:96)
>        at org.apache.tools.ant.Main.runBuild(Main.java:683)
>        at org.apache.tools.ant.Main.startAnt(Main.java:199)
>        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
>        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> Bad version number in .class file
> ================================
> Running the following command:
>
>  ant -diagnostics
>
> gives this output (I have decided to err on the side of caution by including
> all output)
> ================================================
> ------- Ant diagnostics report -------
> Apache Ant version 1.7.0 compiled on January 10 2008
>
> -------------------------------------------
> Implementation Version
> -------------------------------------------
> core tasks     : 1.7.0
> optional tasks : not available
>
> -------------------------------------------
> ANT PROPERTIES
> -------------------------------------------
> ant.version: Apache Ant version 1.7.0 compiled on January 10 2008
> ant.java.version: 1.5
> ant.core.lib: /usr/share/java/ant-1.7.0.jar
> ant.home: /usr/share/ant
>
> -------------------------------------------
> ANT_HOME/lib jar listing
> -------------------------------------------
> ant.home: /usr/share/ant
>
> -------------------------------------------
> USER_HOME/.ant/lib jar listing
> -------------------------------------------
> user.home: /home/david
> No such directory.
>
> -------------------------------------------
> Tasks availability
> -------------------------------------------
> propertyfile : Not Available (the implementation class is not present)
> ccmkdir : Not Available (the implementation class is not present)
> importtypelib : Not Available (the implementation class is not present)
> vsscheckin : Not Available (the implementation class is not present)
> p4reopen : Not Available (the implementation class is not present)
> image : Not Available (the implementation class is not present)
> csc : Not Available (the implementation class is not present)
> sshexec : Not Available (the implementation class is not present)
> wlrun : Not Available (the implementation class is not present)
> p4label : Not Available (the implementation class is not present)
> p4revert : Not Available (the implementation class is not present)
> replaceregexp : Not Available (the implementation class is not present)
> jjtree : Not Available (the implementation class is not present)
> jarlib-display : Not Available (the implementation class is not present)
> jspc : Not Available (the implementation class is not present)
> vsshistory : Not Available (the implementation class is not present)
> p4submit : Not Available (the implementation class is not present)
> scp : Not Available (the implementation class is not present)
> ccmcheckin : Not Available (the implementation class is not present)
> p4change : Not Available (the implementation class is not present)
> p4delete : Not Available (the implementation class is not present)
> vssadd : Not Available (the implementation class is not present)
> p4integrate : Not Available (the implementation class is not present)
> translate : Not Available (the implementation class is not present)
> cclock : Not Available (the implementation class is not present)
> chown : Not Available (the implementation class is not present)
> jarlib-available : Not Available (the implementation class is not present)
> rexec : Not Available (the implementation class is not present)
> WsdlToDotnet : Not Available (the implementation class is not present)
> ejbjar : Not Available (the implementation class is not present)
> stlist : Not Available (the implementation class is not present)
> serverdeploy : Not Available (the implementation class is not present)
> ildasm : Not Available (the implementation class is not present)
> schemavalidate : Not Available (the implementation class is not present)
> cccheckin : Not Available (the implementation class is not present)
> ccunlock : Not Available (the implementation class is not present)
> wljspc : Not Available (the implementation class is not present)
> telnet : Not Available (the implementation class is not present)
> sosget : Not Available (the implementation class is not present)
> p4sync : Not Available (the implementation class is not present)
> ccmklabel : Not Available (the implementation class is not present)
> p4edit : Not Available (the implementation class is not present)
> antlr : Not Available (the implementation class is not present)
> netrexxc : Not Available (the implementation class is not present)
> ftp : Not Available (the implementation class is not present)
> ccmcheckout : Not Available (the implementation class is not present)
> xmlvalidate : Not Available (the implementation class is not present)
> p4resolve : Not Available (the implementation class is not present)
> iplanet-ejbc : Not Available (the implementation class is not present)
> ccmcheckintask : Not Available (the implementation class is not present)
> native2ascii : Not Available (the implementation class is not present)
> ccrmtype : Not Available (the implementation class is not present)
> starteam : Not Available (the implementation class is not present)
> vsscheckout : Not Available (the implementation class is not present)
> mimemail : Not Available (the implementation class is not present)
> stylebook : Not Available (the implementation class is not present)
> soscheckin : Not Available (the implementation class is not present)
> stlabel : Not Available (the implementation class is not present)
> cab : Not Available (the implementation class is not present)
> splash : Not Available (the implementation class is not present)
> ccmkbl : Not Available (the implementation class is not present)
> cccheckout : Not Available (the implementation class is not present)
> p4have : Not Available (the implementation class is not present)
> jdepend : Not Available (the implementation class is not present)
> jsharpc : Not Available (the implementation class is not present)
> symlink : Not Available (the implementation class is not present)
> script : Not Available (the implementation class is not present)
> ccmcreatetask : Not Available (the implementation class is not present)
> rpm : Not Available (the implementation class is not present)
> attrib : Not Available (the implementation class is not present)
> echoproperties : Not Available (the implementation class is not present)
> stcheckin : Not Available (the implementation class is not present)
> chgrp : Not Available (the implementation class is not present)
> stcheckout : Not Available (the implementation class is not present)
> p4labelsync : Not Available (the implementation class is not present)
> vsscreate : Not Available (the implementation class is not present)
> ejbc : Not Available (the implementation class is not present)
> vbc : Not Available (the implementation class is not present)
> wsdltodotnet : Not Available (the implementation class is not present)
> ccmkattr : Not Available (the implementation class is not present)
> ccupdate : Not Available (the implementation class is not present)
> renameext : Not Available (the implementation class is not present)
> vsslabel : Not Available (the implementation class is not present)
> vsscp : Not Available (the implementation class is not present)
> p4fstat : Not Available (the implementation class is not present)
> setproxy : Not Available (the implementation class is not present)
> wlstop : Not Available (the implementation class is not present)
> p4counter : Not Available (the implementation class is not present)
> ilasm : Not Available (the implementation class is not present)
> soscheckout : Not Available (the implementation class is not present)
> ccuncheckout : Not Available (the implementation class is not present)
> jarlib-resolve : Not Available (the implementation class is not present)
> jlink : Not Available (the implementation class is not present)
> javacc : Not Available (the implementation class is not present)
> pvcs : Not Available (the implementation class is not present)
> jarlib-manifest : Not Available (the implementation class is not present)
> ccmklbtype : Not Available (the implementation class is not present)
> sound : Not Available (the implementation class is not present)
> scriptdef : Not Available (the implementation class is not present)
> blgenclient : Not Available (the implementation class is not present)
> jjdoc : Not Available (the implementation class is not present)
> ccmkelem : Not Available (the implementation class is not present)
> javah : Not Available (the implementation class is not present)
> ccmreconfigure : Not Available (the implementation class is not present)
> p4add : Not Available (the implementation class is not present)
> soslabel : Not Available (the implementation class is not present)
> depend : Not Available (the implementation class is not present)
> vssget : 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
> =================================
>
> What am I doing wrong?
>
>
>
> -- 
> View this message in context: http://www.nabble.com/XML-Parser-give-%22bad-version-number-in-.class-file%22-tp24916911p24916911.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-890-8117 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org