Red Hat Bugzilla – Bug 218394
Java compiler and interpreter fail on non-English file names.
Last modified: 2008-04-19 16:06:11 EDT
Description of problem:
When given a Java file with a non-English letter in the filename, the Java
compiler (javac, which is a link to ecj) claims that the file is missing.
If the filename has only English letters but the current directory has a
non-English letter, then the compiler gives the message "No .class file created
for file [...] in [...] because of an IOException: [...] (No such file or
If all file and directory names have only English letters but the class name
inside the Java file has a non-English letter, then the resulting class file
gets its name encoded in UTF-8, which is wrong in my locale.
GIJ crashes when given a .class file with a non-English name, which is probably
related to the errors above. The stack trace is simply:
Exception in thread "main" java.lang.NullPointerException
My locale is sv_SE, which means the correct encoding is ISO 8859-1.
My first guess is that the problem is in GIJ. I'm setting Component to "gcc",
hoping that that includes GIJ and GCJ.
Version-Release number of selected component (if applicable):
ecj is a separate package.
We'll need to try ecj with a proprietary JVM to see whether or not it's a
problem with libgcj's locale handling.
Can you provide an example source file? Preferably something small.
Created attachment 142908 [details]
test script â€“ tests ten combinations
I found yet another case: An English-named .class file in a non-English
directory causes GIJ to throw a NoClassDefFoundError.
Java_filename_encoding.tar.gz contains a set of files to test ten combinations
of file, directory and class names.
The test case is written in ISO 8859-1. I don't know how it might behave in
other locales. If running the test in another locale, don't forget to convert
both the filenames and the files' contents to the local character encoding!
This is a dummy comment which I'm adding in an attempt to get this bug out of
NEEDINFO status, as that apparently didn't happen when I submitted the requested
Since ecj is now being used in GCJ this should be investigated. Changing to
priority to high.
I think this is a libgcj bug.
AFAIK we only encode file names using utf-8.
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.
If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
Thanks for your help, and we apologize again that we haven't handled
these issues to this point.
The process we are following is outlined here:
We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers
I just tried the attachment with IcedTea on F8 and get failures. Moving over to
$ javac -version
java javac 1.7.0-internal
$ java -version
java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-b21)
IcedTea Client VM (build 1.7.0-b21, mixed mode)
This works fine on Rawhide OpenJDK after I set the correct locale encoding:
$ export LANG=en_US.ISO-8859-1
$ readlink -f `which java` && readlink -f `which javac`