Bug#327411: libgcj6-dev: execution of java program compiled with --static fails in gnu.regexp init
Package: libgcj6-dev
Version: 4.0.1-2
Severity: normal
Hello,
When I compile a java program with gcj-4.0, and I link the resulting
object code with --static, the resulting large static executable fails
to execute with the following exception:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.initializeClass() (Unknown Source)
at gnu.regexp.RE.getLocalizedMessage(java.lang.String) (Unknown
Source)
...
(some dozen more stack trace entries)
...
Caused by: java.util.MissingResourceException: Bundle gnu/regexp/MessagesBundlenot found
at java.util.ResourceBundle.getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) (Unknown Source)
at java.util.ResourceBundle.getBundle(java.lang.String, java.util.Locale) (Unknown Source)
at gnu.regexp.RE.<clinit>() (Unknown Source)
at java.lang.Class.initializeClass() (Unknown Source)
...14 more
I don't know a full solution because I haven't really looked at the
structure of libgcj6. However, I found a workaround which might help you
find the source of the bug:
Workaround:
I downloaded GNU classpath and extracted gnu/regexp/MessagesBundle.properties
in the directory where my profiling executable is (well actually in a
subdirectory gnu/regexp), and then it Just Works(tm).
Therefore, I think this file is not properly included in some part of
libgcj6 (probably to do with gnu.regexp).
The problem doesn't occur when I compile a dynamic java executable, in
other words when I don't use --static
Apologies for the mishmash in installed gcj version numbers :-)
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.27
Locale: LANG=C, LC_CTYPE=C
Versions of packages libgcj6-dev depends on:
ii gcj-4.0 4.0.1-2 The GNU compiler for Java(TM)
ii libc6-dev 2.3.2.ds1-22 GNU C Library: Development Librari
ii libgcj6 4.0.1-2 Java runtime library for use with
ii libgcj6-awt 4.0.1-2 AWT peer runtime libraries for use
ii libgcj6-common 4.0.1-2 Java runtime library for use with
ii zlib1g-dev 1:1.2.2-4.sarge.1 compression library - development
-- no debconf information
Reply to: