This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
cool hack
- To: Java Discuss List <java-discuss at sourceware dot cygnus dot com>
- Subject: cool hack
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 11 Feb 2000 16:48:43 -0700
- Reply-To: tromey at cygnus dot com
The other day I discovered a cool hack. (Maybe it is obvious, but I
think it is cool.)
If you compile a .java file to a .so, and it has a main method, you
can run it with `gij':
creche. gcj -shared -c -o HelloWorld.so HelloWorld.java
creche. gij HelloWorld
Hello World!
This works because gij uses Class.forName, which now knows how to load
shared objects.
Tom