简体   繁体   English

Jasmin HelloWorld示例失败

[英]Jasmin HelloWorld Example Failing

I'm having a problem executing a newly compiled HelloWorld.j from the jasmin-2.4 distribution. 我在从jasmin-2.4发行版执行新编译的HelloWorld.j时遇到问题。

I downloaded jasmin-2.4. 我下载了jasmin-2.4。 I can compile ok using: 我可以编译好使用:

java -jar jasmin.jar examples\\HelloWorld.j java -jar jasmin.jar examples \\ HelloWorld.j

the output is: 输出是:

Generated: NoJad\\j.class 生成:NoJad \\ j.class

When I execute the newly compiled program: 当我执行新编译的程序时:

java NoJad.j 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. 线程“main”中的异常java.lang.VerifyError :(类:NoJad / j,方法:主签名:([Ljava / lang / String;)V)期望在堆栈上找到对象/数组无法找到主类: NoJad.j。 Program will exit. 程序将会退出。

I'm inclined to believe that this is a bug in the HelloWorld.j example. 我倾向于认为这是HelloWorld.j示例中的一个错误。 Perhaps a new verifier has caught a bug??? 也许一个新的验证者发现了一个错误?

Note 1: the pre-compiled HelloWorld.class in the distribution works as expected. 注1:分发中预编译的HelloWorld.class按预期工作。

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) 注2:我正在使用此版本的java java版本“1.6.0_24”Java(TM)SE运行时环境(版本1.6.0_24-b07)Java HotSpot(TM)64位服务器VM(版本19.1-b02,混合模式)

Here's the HelloWorld.j file from the distribution: 这是分发中的HelloWorld.j文件:

; --- 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. 问题是HelloWorld.j文件是假的。 See this thread: http://sourceforge.net/projects/jasmin/forums/forum/349052/topic/3330588 请参阅此主题: http//sourceforge.net/projects/jasmin/forums/forum/349052/topic/3330588

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM