Jasmin HelloWorld Example Failing
I'm having a problem executing a newly compiled HelloWorld.j from the jasmin-2.4 distribution.
I downloaded jasmin-2.4. I can compile ok using:
java -jar jasmin.jar examples\HelloWorld.j
the output is:
Generated: NoJad\j.class
When I execute the newly compiled program:
java NoJad.j
an exception is thrown:
Exception in thread "main" java.lang.VerifyError: (class: NoJad/j, method: main signature: ([Ljava/lang/String;)V) Expecting to find object/array on stack Could not find the main class: NoJad.j. Program will exit.
I'm inclined to believe that this is a bug in the HelloWorld.j example. Perhaps a 开发者_高级运维new verifier has caught a bug???
Note 1: the pre-compiled HelloWorld.class in the distribution works as expected.
Note 2: I'm using this version of java java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
Here's the HelloWorld.j file from the distribution:
; --- Copyright Jonathan Meyer 1996. All rights reserved. -----------------
; File: jasmin/examples/HelloWorld.j
; Author: Jonathan Meyer, 10 July 1996
; Purpose: Prints out "Hello World!"
; -------------------------------------------------------------------------
.class public NoJad.j
.super java/lang/Object
;
; standard initializer
.method public <init>()V
aload_0
invokenonvirtual java/lang/Object/<init>()V
return
.end method
.method public static main([Ljava/lang/String;)V
.limit stack 2
.limit locals 2
bipush 2
astore 0
bipush 3
astore 1
aload 0
aload 1
astore 0
astore 1
return
.end method
The problem is the HelloWorld.j file is bogus. See this thread: http://sourceforge.net/projects/jasmin/forums/forum/349052/topic/3330588
精彩评论