Compiling Servlets to native code with GCJ (and Tomcat)

Jeff Sturm
Thu Feb 10 10:25:00 GMT 2000

"Gust, Micron" wrote:
> I am trying to use gcj to compile Java servlets. What I've heard is that you
> need to compile both the servlet engine and the servlet into one executable.
> So I've decided to try this using Apache's Tomcat servlet engine.

You'll have trouble doing this with gcj, since Tomcat relies on object
serialization and RMI (IIRC), which aren't currently supported by

> I downloaded both the .class files and the source code, but I don't know how
> to begin the compilation since there are so many .class files. I have looked
> at the source code, but I don't know which main method is the entry point
> into the application.

But to answer your question, compile class files as you would sources:

  gcj -O2 -c *.class
  gcj -O2 *.o --main=name-of-main-class -o name-of-executable

Find out how Tomcat is invoked (there is probably a shell script
somewhere).  The main entry point should be identified by the `java'
command line.

Jeff Sturm

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list