https://bugzilla.redhat.com/show_bug.cgi?id=2368701
Bug ID: 2368701 Summary: msgfmt: Java compiler not found, try installing gcj or set $JAVAC Product: Fedora Version: rawhide Hardware: x86_64 OS: Linux Status: NEW Component: gettext Severity: high Assignee: matiwari@redhat.com Reporter: mail@tim-greller.de QA Contact: extras-qa@fedoraproject.org CC: dueno@redhat.com, i18n-bugs@lists.fedoraproject.org, matiwari@redhat.com, nphilipp@redhat.com, petersen@redhat.com, sundeep_anand@yahoo.com Target Milestone: --- Classification: Fedora
When I execute msgfmt with --java2, I get the following error:
msgfmt: Java compiler not found, try installing gcj or set $JAVAC msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
--verbose only shows the additional line with x translated messages, ...
If I run javac -version, I get: javac 17.0.7 And for java -version, I get: openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1deb11u1, mixed mode, sharing)
As suggested in the error message, I tried setting $JAVAC. It's now set to /usr/lib/jvm/java-17-openjdk-amd64/bin but I still get the same error.
Reproducible: Always
Steps to Reproduce: 1. Create a de.po file (e.g. using xgettext and poedit) 2. Run msgfmt --java2 -d src/conf -r app.i18n.Messages -l de po/de.po Actual Results: msgfmt: Java compiler not found, try installing gcj or set $JAVAC msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
Expected Results: No error, but a ResourceBundle class
https://bugzilla.redhat.com/show_bug.cgi?id=2368701
Tim Greller mail@tim-greller.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Comment|0 |updated
--- Comment #0 has been edited ---
When I execute msgfmt with --java2, I get the following error:
msgfmt: Java compiler not found, try installing gcj or set $JAVAC msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
--verbose only shows the additional line with x translated messages, ... msgfmt (v0.21) is installed by installing the latest version of gettext.
If I run javac -version, I get: javac 17.0.7 And for java -version, I get: openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1deb11u1, mixed mode, sharing)
As suggested in the error message, I tried setting $JAVAC. It's now set to /usr/lib/jvm/java-17-openjdk-amd64/bin but I still get the same error.
Reproducible: Always
Steps to Reproduce: 1. Create a de.po file (e.g. using xgettext and poedit) 2. Run msgfmt --java2 -d src/conf -r app.i18n.Messages -l de po/de.po Actual Results: msgfmt: Java compiler not found, try installing gcj or set $JAVAC msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
Expected Results: No error, but a ResourceBundle class
https://bugzilla.redhat.com/show_bug.cgi?id=2368701
Tim Greller mail@tim-greller.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Comment|0 |updated
--- Comment #0 has been edited ---
When I execute msgfmt with --java2, I get the following error:
msgfmt: Java compiler not found, try installing gcj or set $JAVAC msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
--verbose only shows the additional line with x translated messages, ... msgfmt (v0.21) is installed by installing the latest version of gettext. I also built and installed what seems to be a newer version from https://answers.launchpad.net/ubuntu/+source/gettext/0.23.1-2, but it doesn't seem to include msgfmt?
If I run javac -version, I get: javac 17.0.7 And for java -version, I get: openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment (build 17.0.7+7-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 17.0.7+7-Debian-1deb11u1, mixed mode, sharing)
As suggested in the error message, I tried setting $JAVAC. It's now set to /usr/lib/jvm/java-17-openjdk-amd64/bin but I still get the same error.
Reproducible: Always
Steps to Reproduce: 1. Create a de.po file (e.g. using xgettext and poedit) 2. Run msgfmt --java2 -d src/conf -r app.i18n.Messages -l de po/de.po Actual Results: msgfmt: Java compiler not found, try installing gcj or set $JAVAC msgfmt: compilation of Java class failed, please try --verbose or set $JAVAC
Expected Results: No error, but a ResourceBundle class
https://bugzilla.redhat.com/show_bug.cgi?id=2368701
--- Comment #1 from Manish Tiwari matiwari@redhat.com --- Hi Tim, Setting up JAVAC to the full path of javac binary (not the directory) worked for me : export JAVAC=/usr/lib/jvm/java-21-openjdk/bin/javac
https://bugzilla.redhat.com/show_bug.cgi?id=2368701
Tim Greller mail@tim-greller.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution|--- |DUPLICATE Last Closed| |2025-05-28 12:56:00
--- Comment #2 from Tim Greller mail@tim-greller.de --- Hi Manish,
thanks for your reply! JAVAC doesn't seem to matter, though.
I tried it again with JAVAC set to both values and not set to anything at all, and all three of them worked. All I needed to do to fix it was reboot my system. Now, the 0.23 version I tried to install last time from https://answers.launchpad.net/ubuntu/+source/gettext/0.23.1-2 works. So the bug I was experiencing was the same as https://bugzilla.redhat.com/show_bug.cgi?id=2062407. It's just hard to get the latest version of the tool imo.
*** This bug has been marked as a duplicate of bug 2062407 ***
i18n-bugs@lists.fedoraproject.org