This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


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

cool hack


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

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