This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Problems using the GCJ interpreter
- From: "Ranjit Mathew" <rmathew4lists at hotmail dot com>
- To: Øyvind Harboe <oyvind dot harboe at zylin dot com>,<java at gcc dot gnu dot org>
- Date: Thu, 20 Feb 2003 09:28:12 +0530
- Subject: Re: Problems using the GCJ interpreter
- References: <41D1051F31A2674C99E41CA28EE734980A1F82@isp-ex2k.intellimade.net>
- Reply-to: "Ranjit Mathew" <rmathew at hotmail dot com>
>I read up on the FAQ. Is it true that the GCJ interpreter does not
>work under Windows? The information seems a bit out of date, when I read
>this mailing list.
No, it does work under Windows. To see it in action:
File Foo.java:
----------------------------------------------------------------
public class Foo {
public String toString( ) { return "Not in my name!"; }
}
----------------------------------------------------------------
File Bar.java:
----------------------------------------------------------------
public class Bar {
public static void main(String[] args) {
System.out.println( Class.forName( "Foo").newInstance( ));
}
}
----------------------------------------------------------------
Then:
gcj -C Foo.java
gcj --main=Bar Bar.java
The fact that it shows Foo.toString( ) means that it works.
To be really certain, change the string in Foo.toString( ) and
just compile (to a .class) Foo.java again without recompiling
Bar.java - you'll see the updated string.
As Tom pointed out, when you directly reference classes in your
code, they are statically resolved and without libswt.a, you
get the errors you see.
Hope this helps.
Ranjit.