Static executables
Andrew Haley
aph@redhat.com
Tue Jan 31 12:38:00 GMT 2006
Andrzej Bialecki writes:
> Tom Tromey wrote:
> >>>>>> "Andrzej" == Andrzej Bialecki <ab@getopt.org> writes:
> >>>>>>
> >
> > Andrzej> The question is: is it possible to build static binaries on Linux/BSD,
> > Andrzej> and if yes, what is the right incantation to do this, for input files
> > Andrzej> consisting of a mix of *.java, *.jar, and JNI *.o objects? Eg. if I'm
> > Andrzej> using Fedora Core 4, which sports gcc 4.0.2, whenever I try to pass
> > Andrzej> the -static flag, the compiler complains that static compilation is
> > Andrzej> not supported.
> >
> > Funny, I didn't realize that this error was in there.
> > I don't remember this decision.
> >
> > Andrzej> * it's not supported, because it's broken in some well-defined cases
> >
> > Any code that uses reflection will not work properly. This is a
> > problem because parts of the core class library depend on reflection.
> > For instance, character set translators and locales are loaded this
> > way.
>
> Ugh, that's pretty serious ... Ok, then this means that it's not
> possible to redistribute binaries to machines where there is no runtime
> installation. :-( Or at least not as a single file.
I don't get it.
Why is that an issue? Surely you can wrap your application and
whatever libraries it requires in a package and distribute that.
Andrew.
More information about the Java
mailing list