RFR: 8243255: Font size is large in JavaFX app with enabled Monocle on Raspberry Pi
Alexander Scherbatiy
alexsch at openjdk.java.net
Mon Apr 27 11:11:04 UTC 2020
On Fri, 24 Apr 2020 17:07:25 GMT, John Neffenger <github.com+1413266+jgneff at openjdk.org> wrote:
>>> To debug the JavaFX on Raspberry Pi I built armv6hf-sdk and just copied the file _javafx.platform.properties_ from the
>>> full jdk version with JavaFX to jdk-14.0.1/lib directory of jdk without JavaFX which I used to run my java application
>>> with JavaFX modules from armv6hf-sdk/lib.
>>
>> May I then suggest one additional change to this pull request? It's a two-line fix:
>>
>> --- a/modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java
>> +++ b/modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java
>> @@ -238,8 +238,7 @@ public class PlatformUtil {
>> // Strip everything after the last "/" or "" to get rid of the jar filename
>> int lastIndexOfSlash = Math.max(
>> s.lastIndexOf('/'), s.lastIndexOf('\'));
>> - return new File(new URL(s.substring(0, lastIndexOfSlash + 1)).getPath())
>> - .getParentFile();
>> + return new File(new URL(s.substring(0, lastIndexOfSlash + 1)).getPath());
>> } catch (MalformedURLException e) {
>> return null;
>> }
>>
>> That change corrects the code to look for the `javafx.platform.properties` file in the same directory as the
>> `javafx.base.jar` file instead of looking for it in the parent directory of the JAR file. I just stepped through the
>> code with this change, and the method `PlatformUtil.loadProperties` now finds the properties file in the location where
>> it is packaged by the build in the SDK.
>
> Related issues, including the original request for enhancement:
>
> * [JDK-8100775](https://bugs.openjdk.java.net/browse/JDK-8100775): Means of bundling platform specific settings for
> glass/runtime
> * [JDK-8115678](https://bugs.openjdk.java.net/browse/JDK-8115678): JavaFX preview on Raspberry Pi
> requires -Djavafx.platform=eglfb to be set
> * [JDK-8117705](https://bugs.openjdk.java.net/browse/JDK-8117705): Embedded JavaFX can't find javafx.platform.properties
>
> The last two issues listed above were fixed by the following changeset:
>
> [Fix for RT-28035 (Can't find embedded platform properties) and RT-27194 (Must set
> javafx.platform)](https://hg.openjdk.java.net/openjfx/8/master/rt/rev/e4577fd9c0f1)
> In JDK 8, all of the Java property files, including `javafx.platform.properties`, are located under the `jre/lib`
> directory of the JDK, but the JavaFX 8 JAR file `jfxrt.jar` in found in the subdirectory `jre/lib/ext`. The changeset
> above fixed the JavaFX 8 code to look in the parent directory for its properties. Now, though, the JavaFX SDK puts the
> JAR file `javafx.base.jar` in the same `lib` directory as the property files, so we need to remove the method call that
> changes the path to its parent.
> May I then suggest one additional change to this pull request? It's a two-line fix.
> That change corrects the code to look for the `javafx.platform.properties` file in the same directory as the
> `javafx.base.jar` file instead of looking for it in the parent directory of the JAR file.
I have added the fix for `PlatformUtil.getRTDir()` method to the current pull request.
-------------
PR: https://git.openjdk.java.net/jfx/pull/193
More information about the openjfx-dev
mailing list