Skip to content
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

Webkit used in JavaFX 18.0.1 breaks the library #204

Open
dlemmermann opened this issue May 11, 2022 · 8 comments
Open

Webkit used in JavaFX 18.0.1 breaks the library #204

dlemmermann opened this issue May 11, 2022 · 8 comments

Comments

@dlemmermann
Copy link
Collaborator

No maps are rendered when using JavaFX 18.0.1 with its upgraded WebKit version.

@trixon
Copy link

trixon commented May 12, 2022

FWIW, It's works for me, here on Windows with an FX bundled JDK from Azul.

image

...and some exclusions in the pom https://github.com/trixon/mapton/blob/86ae5376e83f74abb53fb8445f057f03843cbc30/modules/google-maps/pom.xml#L65

@dlemmermann
Copy link
Collaborator Author

Can you please try cloning this project and running the "MainApp" class? With 18 and then with 18.0.1?

@dlemmermann
Copy link
Collaborator Author

Also .... do you know which javafx version is bundled with the 18.0.1 JDK?

@dlemmermann
Copy link
Collaborator Author

I checked myself ... seems to be 18.0.1 ... interesting ... why does it work there?

Bildschirmfoto 2022-05-12 um 10 04 51

@trixon
Copy link

trixon commented May 12, 2022

@dlemmermann I did some testing and can confirm the problems.
Actually I had problems with earlier versions too.

Some time ago I ran into that JavaFX will not load nicely from the classpath anymore.
https://bugs.openjdk.java.net/browse/JDK-8256362

So I replaced maven-exec-plugin in your pom with this inspired by the -new project wizzard- in NetBeans.
With that I'm able to run your MainApp.

            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <configuration>
                    <mainClass>com.dlsc.gmapsfx.MainApp</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <!-- Default configuration for running -->
                        <!-- Usage: mvn clean javafx:run -->
                        <id>default-cli</id>
                    </execution>
                    <execution>
                        <!-- Configuration for manual attach debugging -->
                        <!-- Usage: mvn clean javafx:run@debug -->
                        <id>debug</id>
                        <configuration>
                            <options>
                                <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000</option>
                            </options>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Configuration for automatic IDE debugging -->
                        <id>ide-debug</id>
                        <configuration>
                            <options>
                                <option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option>
                            </options>
                        </configuration>
                    </execution>
                    <execution>
                        <!-- Configuration for automatic IDE profiling -->
                        <id>ide-profile</id>
                        <configuration>
                            <options>
				<option>${profiler.jvmargs.arg1}</option>
				<option>${profiler.jvmargs.arg2}</option>
				<option>${profiler.jvmargs.arg3}</option>
				<option>${profiler.jvmargs.arg4}</option>
				<option>${profiler.jvmargs.arg5}</option>
                            </options>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

@trixon
Copy link

trixon commented Feb 23, 2023

@dlemmermann Is this of any help?

I took another look at this and noticed that even the javafx version 17.0.2 did not work for me with Temurine jdk-11.0.18+10. I got it working by reordering the start method like so:

public void start(final Stage stage) throws Exception {
    System.out.println("Java version: " + System.getProperty("java.home"));
    BorderPane bp = new BorderPane();
    Scene scene = new Scene(bp);
    stage.setScene(scene);
    stage.show();

    mapComponent = new GoogleMapView(Locale.getDefault().getLanguage(), null);
    ...

But then I reverted that and used a new version, <javafx.version>19.0.2.1</javafx.version>, and that worked too for me.

@dlemmermann
Copy link
Collaborator Author

no, that is not helping :-) so you changed the order and it worked and then you changed it back and it still worked? Sounds to me like you didn't actually run with the newer javafx versions.

@trixon
Copy link

trixon commented Feb 24, 2023

That's not what I said, but I'm somewhat confused and had to triple check.
My observations are:

The java code change is required for me on window with Temurin 11 if I use javafx 17.0.2 or 18.
Using 18.0.1 or later works just fine without the code change. This is the opposite of your issue.

An alternative to get it working is by using the javafx jmods.

I'm unable to reproduce this problem on Fedora 37 Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants