This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: classpaths and jar files
- To: Per Bothner <per at bothner dot com>
- Subject: Re: classpaths and jar files
- From: Tom Tromey <tromey at redhat dot com>
- Date: 11 Jul 2001 00:51:23 -0600
- Cc: "Anthony Green" <green at redhat dot com>, "Java at Gcc dot Gnu. Org" <java at gcc dot gnu dot org>
- References: <000101c1069a$a134b200$5be6b4cd@cygnus.com> <m2pubd9tam.fsf@kelso.bothner.com>
- Reply-To: tromey at redhat dot com
>>>>> "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