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

GMapsFX application with Java 11 immediately exits #185

Open
jdsmithsos opened this issue Jul 3, 2019 · 1 comment
Open

GMapsFX application with Java 11 immediately exits #185

jdsmithsos opened this issue Jul 3, 2019 · 1 comment

Comments

@jdsmithsos
Copy link

I have been struggling with this for days now.
I successfully upgraded to Java 10 using GMapsFX 2.12.0.
When I upgrade to Java 11, the application immediately exits.
I have debugged this in NetBeans with my application, and found that a ClassNotFoundException is being thrown by the class loader, because the com.sun.webkit.MainThread class cannot be found.

I have tested the upgrade with the Directions example application, and the same thing happens with Java 11.

This combination works: Java 10, GMapsFX 2.12.0, OpenJFX 12.0.1.
This combination does NOT work: Java 11, GMapsFX 2.12.0, OpenJFX 12.0.1.

I even upgraded a copy of GMapsFX to Java 11, and built Java 11 binaries, but that didn't work either.

I am at a loss.
Has anybody solved this problem by project dependencies?
Is there a known workaround/configuration to get GMapsFX to work with Java 11?
Is this a known problem that is planned to be fixed in the next release of GMapsFX?

Thanks in advance for any help that anybody can provide.

@jdsmithsos
Copy link
Author

I spent some time and discovered the exact line that is causing this ClassNotFoundException.
This can be reproduced using the OpenJFX WebView, and loading an HTML file that uses Google Maps.
I realize that GMapsFX does this differently, through executing Javascript through the code, but that is doing effectively the same thing that is shown in the code snippet below.
In html Javascript, create a new google.maps.Map object.
This ClassNotFoundException occurs with Java 11 and OpenJFX 12.0.1.

		function initMap() {
                        var center = {lat: 39.7392, lng: -104.9903};
                        // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                        // creating the Map is what is causing the ClassNotFoundException, for com.sun.webkit.MainThread!!!
                        // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                        map = new google.maps.Map(document.getElementById('map-canvas'), {
                            zoom: 4,
                            center: center
                          });

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

1 participant