Patch: Fix for PR 2369

Tom Tromey tromey@redhat.com
Sun Nov 25 18:00:00 GMT 2001


>>>>> "Bryce" == Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:

Bryce> If we passed the --main option through to jc1, it could verify
Bryce> that it is not only a valid class name but also an actual class
Bryce> that contains a "main" method.

This would be a nice feature.

Bryce> So, maybe the ultimate fix would be to get rid of the jvgenmain
Bryce> stuff, and have jc1 generate the C "main" itself. The driver
Bryce> would pass "-fmain" if a main method is required but was not
Bryce> specified, or -fmain=xxx if the user specified one.

Another thing we can pay attention to is that a jar file can contain
the name of the main class.  It would be nice if gcj could recognize
this automatically.  We have a PR on it.

One idea I had was to have jvgenmain know how to read the jar file and
extract the main class name.  However jvgenmain can't determine
whether the `--main' argument really names a class.  If it could do
this it would need the parser in it.

Tom



More information about the Java-patches mailing list