mdshamim06 / jenabean

Automatically exported from code.google.com/p/jenabean
0 stars 0 forks source link

UnsupportedClassVersionError: Bad version number in .class file #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download jenabean-0.0.8.jar and jena 2.5.6
2. created Song.java and SimpleExample.java

import java.util.Collection;

import thewebsemantic.Id;
import thewebsemantic.RdfBean;
import thewebsemantic.binding.Jenabean;

public class Song extends RdfBean<Song> {
    private String composer;
    private String title;

    public static Collection<Song> load() {
        return Jenabean.load(Song.class);
    }

    @Id
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getComposer() {
        return composer;
    }

    public void setComposer(String composer) {
        this.composer = composer;
    }

}

import java.util.Collection;

import thewebsemantic.binding.Jenabean;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;

public class SimpleExample {
    public static void main(String[] args) {
        Model m = ModelFactory.createDefaultModel();
        Jenabean.instance().bind(m);

        Song s2 = new Song();
        s2.setTitle("I.G.Y.");
        s2.setComposer("Donald Fagen");
        s2.save();

        Collection<Song> songs = Song.load();
        assert (songs.size() == 2);

        for (Song song : songs)
            System.out.println(song.getTitle());
        m.write(System.out, "N3");
    }
}

What is the expected output? What do you see instead?

Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version 
number in .class 
file
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
    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:316)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
    at com.xx.jena.SimpleExample.main(SimpleExample.java:13)

What version of the product are you using? On what operating system?
jenabean 0.0.8, jena 2.5.6, on Mac Leopard with JVM1.5.0_13.

Here is my classpath entry when I run the example if that helps:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="lib" path="lib/antlr-2.7.5.jar"/>
    <classpathentry kind="lib" path="lib/arq-extra.jar"/>
    <classpathentry kind="lib" path="lib/arq.jar"/>
    <classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
    <classpathentry kind="lib" path="lib/concurrent.jar"/>
    <classpathentry kind="lib" path="lib/icu4j_3_4.jar"/>
    <classpathentry kind="lib" path="lib/iri.jar"/>
    <classpathentry kind="lib" path="lib/jena.jar"/>
    <classpathentry kind="lib" path="lib/jenabean-0.0.8.jar"/>
    <classpathentry kind="lib" path="lib/jenatest.jar"/>
    <classpathentry kind="lib" path="lib/json.jar"/>
    <classpathentry kind="lib" path="lib/junit.jar"/>
    <classpathentry kind="lib" path="lib/log4j-1.2.12.jar"/>
    <classpathentry kind="lib" path="lib/lucene-core-2.0.0.jar"/>
    <classpathentry kind="lib" path="lib/stax-api-1.0.jar"/>
    <classpathentry kind="lib" path="lib/wstx-asl-3.0.0.jar"/>
    <classpathentry kind="lib" path="lib/xercesImpl.jar"/>
    <classpathentry kind="lib" path="lib/xml-apis.jar"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

Please provide any additional information below.

Original issue reported on code.google.com by darth.xuan@gmail.com on 14 Aug 2008 at 5:56

Attachments:

GoogleCodeExporter commented 9 years ago
I'm not able to reproduce, nor have I heard back from any others having a 
similar
issue. I suspect it has something to do with the JVM version and a Mac.
jvm 1.6 is available now on mac.

Original comment by thewebse...@gmail.com on 5 Feb 2009 at 4:01