cool hack

Tom Tromey tromey@cygnus.com
Sat Apr 1 00:00:00 GMT 2000


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


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /