LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 10-19-2004, 03:39 AM   #1
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
emerge problem for dev-java/ant


# emerge dev-java/ant
Calculating dependencies ...done!
>>> emerge (1 of 13) dev-java/jdepend-2.6-r1 to /
>>> md5 src_uri Wink jdepend-2.6.zip
>>> Unpacking source...
>>> Unpacking jdepend-2.6.zip to /var/tmp/portage/jdepend-2.6-r1/work
>>> Source unpacked.
Buildfile: build.xml

BUILD FAILED
java.lang.UnsupportedClassVersionError: org/apache/xerces/jaxp/SAXParserFactoryImpl (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:93)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:174)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:87)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:114)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:100)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:163)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:184)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:131)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
at org.apache.tools.ant.Main.runBuild(Main.java:658)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)

Total time: 0 seconds
java.lang.UnsupportedClassVersionError: org/apache/xerces/jaxp/SAXParserFactoryImpl (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:93)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:174)
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:87)
at org.apache.tools.ant.util.JAXPUtils.newParserFactory(JAXPUtils.java:114)
at org.apache.tools.ant.util.JAXPUtils.getNSParserFactory(JAXPUtils.java:100)
at org.apache.tools.ant.util.JAXPUtils.getNamespaceXMLReader(JAXPUtils.java:163)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:184)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:131)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
at org.apache.tools.ant.Main.runBuild(Main.java:658)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:196)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
org/apache/xerces/jaxp/SAXParserFactoryImpl (Unsupported major.minor version 49.0)

!!! ERROR: dev-java/jdepend-2.6-r1 failed.
!!! Function src_compile, Line 32, Exitcode 1
!!! Failed Compiling


Any idea?
 
Old 10-19-2004, 05:14 AM   #2
Comrade Chez
LQ Newbie
 
Registered: Feb 2004
Posts: 16

Rep: Reputation: 0
Code:
emerge --pretend jdepend | less
Turned up:

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild N ] dev-java/java-config-1.2.10
[ebuild N ] dev-java/blackdown-jdk-1.4.1
[ebuild N ] dev-java/ant-core-1.6.2
[ebuild N ] app-arch/unzip-5.50-r2
[ebuild N ] dev-java/jdepend-2.6-r1

Presumably for some reason its trying to emerge jdepend before the others. Try emerging jdepend itself, or the above packages manually if that fails.
 
Old 10-20-2004, 12:07 AM   #3
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Original Poster
Rep: Reputation: 31
Got the same problem if I just do "emerge jdepend".........
 
Old 09-02-2005, 09:44 AM   #4
zanderredux
LQ Newbie
 
Registered: Sep 2005
Posts: 1

Rep: Reputation: 0
Solution

I got it. The problem is that some libraries were compiled against different versions of Java.

First, some definitions:
* major.minor 49.0 is J2SE 5.0
* major.minor 48.0 is J2SE 1.4.2.x

The error:
java.lang.UnsupportedClassVersionError: org/apache/xerces/jaxp/SAXParserFactoryImpl (Unsupported major.minor version 49.0)

Shows that you've previously compiled Xerces using J2SE 5.0, but you're trying to compile Ant with J2SE 1.4.2.x

The solution is to unmerge Xerces, set the JVM to 1.4.2 and re-emerge Xerces. Do as follows:

1. emerge unmerge xerces

2. java-config --set-system-vm=sun-jdk-1.4.2.08 (I'm using Sun's JRE, but feel free to use any other 1.4.2 VM)

3. emerge xerces

After xerces is compiled, try to emerge ant again. This time it will work, since the compiled library will be tagged with the correct major.minor information.

-----

You can do the same if you get messages like:

[javac] /var/tmp/portage/bcel-5.1-r1/work/bcel-5.1/src/java/org/apache/bcel/util/InstructionFinder.java:232: cannot access org.apache.regexp.RE
[javac] bad class file: /usr/share/jakarta-regexp-1.3/lib/jakarta-regexp.jar(org/apache/regexp/RE.class)
[javac] class file has wrong version 49.0, should be 48.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] RE regex = new RE(search);
[javac] ^
[javac] 1 error

In this case, unmerging and emerging back the offending library will suffice:

emerge unmerge jakarta-regexp && emerge jakarta-regexp


-----

So, there's this rule we can apply while Java 1.4 stuff has to live along with Java 1.5 stuff:

When emerging something related to Java, always set the system-wide JVM to the 1.4 series. After you're done emerging, you're free to set it back to the Java 5 VM.

Hope it helps.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ant limewire and java kevner Slackware 3 06-29-2005 07:48 AM
problem with ant os2 Programming 1 05-20-2005 12:13 AM
Please help. Gentoo: Emerge gentoo-dev-sources fails sendas4 Linux - Newbie 3 07-19-2004 11:44 AM
Ant & args for java acjt Programming 1 04-25-2004 12:01 AM
java ant tomcat j-ray Linux - Software 1 09-12-2002 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 04:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration