classpaths and jar files

Tom Tromey tromey@redhat.com
Tue Jul 10 23:28:00 GMT 2001


>>>>> "Per" == Per Bothner <per@bothner.com> writes:

Per> I would rather have any resource files etc from a .jar be
Per> compiled into the executable (or shared library).
I definitely agree.
Per> Thus a resource file should be compiled to an initialized byte
Per> array in a read-only data segment.
One way to do this, which is pretty lame but easy to implement, is to
compile the resource file into an appropriately-named Java class file
which is then compiled and linked in to the application. This is a
bit of a hack though.
I guess we could implement this "for real" by defining a global table
which maps resource bundle names to byte arrays. Then we would use
static constructors to initialize the table. Finally we would write a
simple gcc front end to turn a resource file into a small C++ program
which we'd run through cc1plus. This actually wouldn't be too hard.
Tom


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /