This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem: Java interpreter does not work


I tried to run Java interpreter, but it doesn't work. 
Here is how it looks like:

[~/Java] cat HelloWorld.java
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    } // main
}
[~/Java] jikes -bootclasspath
/usr/share/java/libgcj-3.4.4.jar HelloWorld.java
[~/Java] gij HelloWorld.class
Exception in thread "main"
java.lang.NoClassDefFoundError: HelloWorld.class
   <<No stacktrace available>>
[~/Java] jcf-dump HelloWorld.class
Reading .class from HelloWorld.class.
Magic number: 0xcafebabe, minor_version: 0,
major_version: 48.

Constant pool (count: 29):
#1: Utf8: "HelloWorld"
#2: Class name: 1="HelloWorld"
#3: Utf8: "java/lang/Object"
#4: Class name: 3="java/lang/Object"
#5: Utf8: "main"
#6: Utf8: "([Ljava/lang/String;)V"
#7: Utf8: "Code"
#8: Utf8: "LineNumberTable"
#9: Utf8: "out"
#10: Utf8: "Ljava/io/PrintStream;"
#11: NameAndType name: 9=out, signature:
10=java.io.PrintStream
#12: Utf8: "java/lang/System"
#13: Class name: 12="java/lang/System"
#14: Fieldref class: 13=java.lang.System
name_and_type: 11=<out java.io.PrintStr
eam>
#15: Utf8: "Hello world!"
#16: String 15="Hello world!"
#17: Utf8: "println"
#18: Utf8: "(Ljava/lang/String;)V"
#19: NameAndType name: 17=println, signature:
18=(java.lang.String)void
#20: Utf8: "java/io/PrintStream"
#21: Class name: 20="java/io/PrintStream"
#22: Methodref class: 21=java.io.PrintStream
name_and_type: 19=<println (java.la
ng.String)void>
#23: Utf8: "<init>"
#24: Utf8: "()V"
#25: NameAndType name: 23=<init>, signature: 24=()void
#26: Methodref class: 4=java.lang.Object
name_and_type: 25=<<init> ()void>
#27: Utf8: "SourceFile"
#28: Utf8: "HelloWorld.java"

Access flags: 0x21 public super
This class: 2=HelloWorld, super: 4=java.lang.Object
Interfaces (count: 0):

Fields (count: 0):

Methods (count: 2):

Method name:"main" public static Signature:
6=(java.lang.String[])void
Attribute "Code", length:37, max_stack:2,
max_locals:1, code_length:9
Attribute "LineNumberTable", length:10, count: 2

Method name:"<init>" public Signature: 24=()void
Attribute "Code", length:33, max_stack:1,
max_locals:1, code_length:5
Attribute "LineNumberTable", length:10, count: 2

Attributes (count: 1):
Attribute "SourceFile", length:2,
#28="HelloWorld.java"
[~/Java]


 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]