Skip to content

8298266: "java.home property not set" error in Graal when sun.awt.fontconfig java property is set on Windows #11559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/java.desktop/share/classes/sun/awt/FontConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,19 @@ private void findFontConfigFile() {

foundOsSpecificFile = true; // default assumption.
String javaHome = System.getProperty("java.home");
if (javaHome == null) {
throw new Error("java.home property not set");
if (javaHome != null) {
javaLib = javaHome + File.separator + "lib";
}
javaLib = javaHome + File.separator + "lib";
String javaConfFonts = javaHome +
File.separator + "conf" +
File.separator + "fonts";
String userConfigFile = System.getProperty("sun.awt.fontconfig");
if (userConfigFile != null) {
fontConfigFile = new File(userConfigFile);
} else {
if (javaHome == null) {
throw new Error("java.home property not set");
}
String javaConfFonts = javaHome +
File.separator + "conf" +
File.separator + "fonts";
fontConfigFile = findFontConfigFile(javaConfFonts);
if (fontConfigFile == null) {
fontConfigFile = findFontConfigFile(javaLib);
Expand Down