JDO enhancer and Java 1.6: Bad version number in .class file

Home Forums Archived Forums MyEclipse Archived Database Tools (DB Explorer, Hibernate, etc.) JDO enhancer and Java 1.6: Bad version number in .class file

This topic contains 4 replies, has 4 voices, and was last updated by Profile photo of cusdx cusdx 3 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #299012
    Profile photo of rusantos
    rusantos
    Member

    I tried to upgrade a Java web application from jdk 1.5 to jdk 1.6 and I got the following error when running the Oracle Kodo JDO enhancer on the classes generated by MyEclipse:

    BUILD FAILED
    C:\Documents and Settings\rsantos\My Documents\sandbox_svn\de_production\applicationserver\build.xml:79:
    java.lang.IllegalArgumentException: java.lang.UnsupportedClassVersionError: Bad version number in .class file

    Total time: 3 seconds

    I tried on MyEclipse 5.1 and 7.1 with the same results. I use ant to run the Kodo jdo enhancer after the classes are compiled by MyEclipse.

    If I configure MyEclipse to have compiler compliance level 6.0, I get the error above; if I use compiler compliance level 5.0, it works fine. Also, if I compile the same classes outside MyEclipse using the Java compiler that comes with the JDK 1.6, I don’t have problems.

    I opened a ticket with the Oracle Kodo support and they recommended I contacted the MyEclipse support to know if there were any issues with JDK 6. Can anyone help?

    Thanks!

    Rute

    *** Date:
    Wednesday, June 3, 2009 2:39:25 PM EDT

    ** System properties:
    OS=WindowsXP
    OS version=5.1.0
    Java version=1.5.0_11

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 7.1.1
    Build id: 7.1.1-20090310

    *** Eclipse details:
    MyEclipse Enterprise Workbench

    Version: 7.1.1
    Build id: 7.1.1-20090310

    Eclipse Platform

    Version: 3.4.1.r341_v20080731-9I96EiDElYevwz-p1bP5z-NlAaP7vtX6Utotqsu
    Build id: M20080911-1700

    Eclipse Java Development Tools

    Version: 3.4.1.r341_v20080709-0800-7o7tEAfEF_U5qyUgrb2HAp539P97
    Build id: M20080709-0800

    Eclipse Graphical Editing Framework GEF

    Version: 3.4.1.v20080806-67718083A56B4H2A3213573
    Build id: 200809101400

    Eclipse RCP

    Version: 3.4.100.r341_v20080814-989JESIEdAciFYfkZZsBfSwQ2341
    Build id: M20080703-0800

    Eclipse Plug-in Development Environment

    Version: 3.4.1.r341_v20080731-7T7U0E9mlRIuGUYviF_VP
    Build id: M20080703-0800

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -showsplash
    -launcher
    C:\Program Files\Genuitec\MyEclipse 7.1\myeclipse.exe
    -name
    Myeclipse
    –launcher.library
    C:\Program Files\Genuitec\MyEclipse 7.1\../Common\plugins\org.eclipse.equinox.launcher.win32.win32.x86_1.0.101.R34x_v20080731\eclipse_1115.dll
    -startup
    C:\Program Files\Genuitec\MyEclipse 7.1\../Common\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
    -clean
    -configuration
    configuration
    -vm
    C:\Program Files\Genuitec\Common\binary\com.sun.java.jre.win32.x86_1.5.0.011\bin\client\jvm.dll

    #299019
    Profile photo of rmcvay
    rmcvay
    Member

    It might be helpful to know what’s on line 79 of the build.xml.

    #299028

    Rute,

    java.lang.IllegalArgumentException: java.lang.UnsupportedClassVersionError: Bad version number in .class file

    UnsupportedClassVersionError occurs when there is a conflict in the versions of JDK.
    What is the JDK version you are using in your ant script to run Oracle Kodo JDO enhancer?
    To configure MyEclipse default JDK, refer to the following post
    https://www.genuitec.com/forums/topic/myeclipse-jre-jdk-is-wrong/&start=0&postdays=0&postorder=asc&highlight=

    #299067
    Profile photo of rusantos
    rusantos
    Member

    Thanks so much!
    What happened was that I had added the JDK 1.6 to MyEclipse “Installed JREs” but the ant build wasn’t using it.
    The ant build launch configuration JRE was set to ‘run in the same JRE as the workspace’, which I assumed was 1.6 but it was 1.5! I changed it to ‘separate JRE’ and entered the JDK 1.6 and it is now working fine.

    Rute

    #321508
    Profile photo of cusdx
    cusdx
    Member

    Thanks, I had the same issue :)

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.