This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LibGCJ static linking trouble


Hello.

Using gcc instead of gcj for the final link has produced an executable with no run-time dependency on libgcj, and reminded me to go and get my eyeglass prescription checked, but I've now run into another problem:

Unhandled Java exception:
java.lang.ExceptionInInitializerError
at java.lang.Class.initializeClass(MakeTNT)
at gnu.regexp.RE.getLocalizedMessage(MakeTNT)
at gnu.regexp.RESyntax.<clinit>(MakeTNT)
at java.lang.Class.initializeClass(MakeTNT)
at java.util.regex.Pattern.<init>(MakeTNT)
at java.util.regex.Pattern.compile(MakeTNT)
at java.util.regex.Pattern.compile(MakeTNT)
at java.util.regex.Pattern.matches(MakeTNT)
at java.lang.String.matches(MakeTNT)
at ...
Caused by: java.util.MissingResourceException: Bundle gnu/regexp/MessagesBundle not found
at java.util.ResourceBundle.getBundle(MakeTNT)
at java.util.ResourceBundle.getBundle(MakeTNT)
at gnu.regexp.RE.<clinit>(MakeTNT)
at java.lang.Class.initializeClass(MakeTNT)


I can see what's happening here - it's looking for translations of some kind and not finding them - but I don't quite understand why. I'm using a locally-compiled version of gcc-4.1.1 if that's relevant.

I found this problem reported as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327411

with a proposed workaround of copying [gccdir]/gcc-4.1.1/libjava/classpath/resource/gnu/regexp/MessagesBundle.properties as gnu/regexp/MessagesBundle.properties under the directory the executable is in.

When I do that, the executable works fine provided I'm in the directory it's in:

cd ~/toadfarm/bin/linux
./MakeTNT -auto ~/Desktop/monster.lib -o ~/s
[success]

but
cd [anywhere else]
~/toadfarm/bin/linux/MakeTNT -auto ~/Desktop/monster.lib -o ~/s2
gives the error at the start of my message.

strace indicates that MakeTNT is trying to find (in succession)

gnu/regexp/MessagesBundle_en_GB.properties
gnu/regexp/MessagesBundle_en.properties
gnu/regexp/MessagesBundle.class
gnu/regexp/MessagesBundle.properties

under the directory I'm currently in.

Is there an environment variable to deal with this? I've poked around http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html a bit, but get referred back (under documentation for java.lang.ClassLoader.getResource) to implementation-specific details like 'Class loader implementations should override this method to specify where to find resources'.

Many thanks in advance for your help,

Thomas Womack, Global Phasing Ltd.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]