Static executables
Andrzej Bialecki
ab@getopt.org
Tue Jan 31 13:40:00 GMT 2006
Andrew Haley wrote:
> 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.
>
That's precisely what I want to avoid. No installation, no myriads of
dependencies - as long as the kernel is compatible it will work.
--
Best regards,
Andrzej Bialecki <><
___. ___ ___ ___ _ _ __________________________________
[__ || __|__/|__||\/| Information Retrieval, Semantic Web
___|||__|| \| || | Embedded Unix, System Integration
http://www.sigram.com Contact: info at sigram dot com
More information about the Java
mailing list