Resources in natively compiled executables
Chris Burdess
dog@bluezoo.org
Sat Apr 17 12:05:00 GMT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Tom Tromey wrote:
>>> I've now tested the resource inclusion and it works for a simple test
>>> case: see attached, for instance.
>
> Anthony> Are you certain this is really working? Rename your META-INF
> Anthony> directory and then try running.
>
> Yeah, I tried the test case Chris attached and renamed META-INF
> before running, and it failed. I think there's been a regression
> here :-(
Whatever the name of META-INF, and whether or not I prefix "/" to the
name of the requested resource, it works for me on Darwin and Linux on
PowerPC (tested also 20040310). See below:
dog [~/test112] tree
.
|-- M
| `-- resource
|-- Makefile
|-- lib.java
|-- prog
`-- prog.java
1 directory, 6 files
dog [~/test112] make
gcj -C lib.java
jar cf lib.jar lib.class
gcj -c -o lib.o lib.jar
gcc -dynamiclib -flat_namespace -undefined warning -o liblib.dylib lib.o
ld: warning undefined symbols:
__Jv_AllocObjectNoFinalizer
__Jv_InitClass
__Jv_RegisterClass
__Jv_ThrowNullPointerException
java::io::BufferedReader::class$
java::io::BufferedReader::BufferedReader[in-charge](java::io::Reader*)
java::io::InputStreamReader::class$
java::io::InputStreamReader::InputStreamReader[in-charge](java::io::
InputStream*)
java::lang::Class::getResourceAsStream(java::lang::String*)
java::lang::Object::clone()
java::lang::Object::class$
java::lang::Object::equals(java::lang::Object*)
java::lang::Object::finalize()
java::lang::Object::getClass()
java::lang::Object::hashCode()
java::lang::Object::toString()
java::lang::Object::Object[in-charge]()
java::lang::System::out
java::lang::System::class$
java::lang::Exception::class$
vtable for java::lang::Class
___gcj_personality_v0
gcj -c -o prog.o prog.java
gcj --main=prog -o prog -L. -llib prog.o
/usr/bin/ld: warning multiple definitions of symbol _sqrt
/usr/local/lib/gcc/powerpc-apple-darwin7.3.0/3.5.0/../../../
libgcj.dylib(libgcj.6.0.0.dylib-master.o) definition of _sqrt
/usr/lib/libm.dylib(sqrt970.o) definition of _sqrt
dog [~/test112] ./prog
hi
dog [~/test112]
- --
Chris Burdess
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFAgR2N6dl1DEqHgrgRArz3AJ9ihkR2PwSecF4aTP3I1bAJvYzBkACdGXZ3
f2FWi8g3ZupaWptoMUbPwvo=
=I9yr
-----END PGP SIGNATURE-----
More information about the Java
mailing list