masterx2 / noop

Automatically exported from code.google.com/p/noop
Apache License 2.0
0 stars 0 forks source link

Running interpreter on file yields UnsupportedClassVersionError. #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download noop 0.1.0 
2. Run: jar -xf noop-0.1.0-SNAPSHOT.jar to unpack the archive
3. Run: java -verbose -cp $CLASSPATH:. noop.interpreter.InterpreterMain 
HelloWorld helloworld

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

Expected:

   Hello World!

Actual:

[Opened 
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar]
[Opened 
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/ui.jar]
[Opened 
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/laf.jar]

     ... many Opened & Loaded lines omitted ...

[Loaded scala.RandomAccessSeq$MutableSlice$class from 
file:/Users/timstewart/Downloads/noop-0.1.0/]
[Loaded scala.BufferedIterator$Advanced from 
file:/Users/timstewart/Downloads/noop-0.1.0/]
[Loaded scala.RandomAccessSeq$$anon$13 from 
file:/Users/timstewart/Downloads/noop-0.1.0/]
[Loaded java.lang.ClassFormatError from shared objects file]
[Loaded java.lang.UnsupportedClassVersionError from 
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar]
[Loaded sun.misc.ClassFileTransformer from 
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar]
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 noop.grammar.Parser.buildParser(Parser.scala:34)
    at noop.grammar.Parser.parseFile(Parser.scala:38)
    at noop.grammar.Parser.file(Parser.scala:66)
    at noop.interpreter.ClassLoader.getClassDefinition(ClassLoader.scala:35)
    at noop.interpreter.ClassLoader$$anonfun$findClass$1.apply(ClassLoader.scala:59)
    at noop.interpreter.ClassLoader$$anonfun$findClass$1.apply(ClassLoader.scala:51)
    at scala.List.foreach(List.scala:841)
    at noop.interpreter.ClassLoader.findClass(ClassLoader.scala:51)
    at noop.interpreter.InterpreterMain$.main(InterpreterMain.scala:35)
    at noop.interpreter.InterpreterMain.main(InterpreterMain.scala)
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]

What version of the product are you using? On what operating system?

noop version: 0.1.0

Running: java -version 

Yields:

   java version "1.5.0_20"
   Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_20-b02-315)
   Java HotSpot(TM) Client VM (build 1.5.0_20-141, mixed mode, sharing)

OS: Mac OS 10.5.8

Please provide any additional information below.

noop looks very clean.  I'm looking forward to using it.  

I'm guessing that the Scala class files shipped with noop were compiled under a 
previous version of Java and that I need to install that version 
of Java to get everything working.  Or can I install a version of Scala that's 
built for my current version of Java?

Thanks!!

Original issue reported on code.google.com by tim.j.st...@gmail.com on 17 Sep 2009 at 2:01

GoogleCodeExporter commented 9 years ago
The continuous build is compiling with Java 6, so you need to run with a Java 6 
VM.

You could also compile from source with Java 5. I haven't tried it myself, it 
might currently work, but no 
promises that we won't introduce a change which uses Java 6 apis. I think we'll 
officially target Java 6.

Original comment by aeagle22206 on 18 Sep 2009 at 4:36