On Fri, 24 Apr 2020 16:39:07 GMT, John Neffenger 
<github.com+1413266+jgn...@openjdk.org> wrote:

>>> @AlexanderScherbatiy Did you move the _javafx.platform.properties_ file to 
>>> its parent directory manually, as I just did?
>> 
>> I used the full version of jdk 14.0.1 on Raspberry Pi where JavaFX is 
>> included in jdk so the file
>> _javafx.platform.properties_ is already in jdk-14.0.1-full/lib directory.
>> 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.
>
>> 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

-------------

PR: https://git.openjdk.java.net/jfx/pull/193

Reply via email to