Logging + static linking
Andrew Haley
aph@redhat.com
Wed Nov 3 11:57:00 GMT 2004
Mark Anderson writes:
> I am trying to create a statically linked executable that makes use
> of java.util.logging, however, I cannot seem to get it to produce
> any logging output.
This probably won't work, because there is no reference to the logger
support classes that the linker can see. The linker removes from the
object file every class that is not directly reachable from the
program.
You can try to figure out exactly what classes are required and emit
static references to them or link against libgcj with --whole-archive.
I don't recommend either of these routes.
Perhaps you can put the libgcj.jar in your runtime classpath and
interpret the support classes. I don't know if that will work. But I
haven't been able to make it work with static linkage whatever I
tried. I think the problem is with the stack trace infrastructure.
Andrew.
More information about the Java
mailing list