0

I'm trying to create a program that would print some text using jasmin. This is a piece of the whole code:

    zfor:
        1 iload 3 ; pushes z to stack
        2 iload 1 ; pushes i to stack
        3 if_icmpge nextfor ; if (z>=i) goto nextfor
        4 getstatic java/lang/System/out Ljava/io/PrintStream 
        5 ldc "O"  ; push string constant
        6 invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
        7 iinc 3 1 ; z++
        8 goto zfor

after compiling, i'm getting this error:

    Error: A JNI error has occurred, please check your installation and try again.
    Exception in thread "main" java.lang.ClassFormatError: Field "out" in class examples/Triangle has illegal signature "Ljava/io/Printstream"

it seems like the error is somewhere in line 4, since, after making that line as a comment i'm not getting any errors.

rookie
  • 3
  • 4

1 Answers1

0

Add ; to the signature: Ljava/io/PrintStream;

apangin
  • 92,924
  • 10
  • 193
  • 247
  • Signature is either a single character for primitive types (e.g. `B`), or a `L;` for instance classes or `[` for array types. – apangin Aug 22 '15 at 13:31