B4J Question Google Maps - Correct Map Service

barry davis

Member
Licensed User
Longtime User
I have used google maps using B4a and b4i for years, and have not had major issues. But every time i try and use it with B4j, I do not get very far. I assume i need a specific key for B4j. Having said that, I am not sure which Google Map services i need to request. There are services for android and ios, but i assume these will not work for B4J

I loaded the two map demos from the web and get the same result. It never comes back to gmap ready. i assume its the google key. I turned the firewall off just in case, but no change.

Can u point me to the reference that says which google map service i should request.

Thanks in advance,
Barry
 

aminoacid

Active Member
Licensed User
Longtime User
Yes, Your google key is probably invalid if gmap ready does not fire. Though you should get a message on the screen if the API key is invalid.
You are using Java19, right?
 
Upvote 0

barry davis

Member
Licensed User
Longtime User
i am using C:\Program Files\Java\jdk-14.0.1\bin\javac.exe, per the B4J installation instructions page. I assume that is the latest version.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i am using C:\Program Files\Java\jdk-14.0.1\bin\javac.exe, per the B4J installation instructions page. I assume that is the latest version.
It is the wrong version... JGoogleMaps required Java 19.
See

VERY IMPORTANT NOTE on this page:

Under the hood it uses JavaFX WebView with GoogleMaps JavaScript API V3. <- this is the Api you need to configure in google....

Updates:

V2.00 - Depends on OpenJDK 19. Previous versions will not work.

1. OpenJDK 19.0.2 + OpenJFX 17.0.6: https://www.b4x.com/b4j/files/jdk-19.0.2.7z
 
Upvote 0

aminoacid

Active Member
Licensed User
Longtime User
i am using C:\Program Files\Java\jdk-14.0.1\bin\javac.exe, per the B4J installation instructions page. I assume that is the latest version.

No, you have to use Java19 just for this version of Google Maps - not necessary for other B4J apps. Refer to the info that @DonManfred has in his post.

You don't need to uninstall Java 14. Just install 19 from the link above and add the following reference to your Project Attributes:

#JavaCompilerPath: 19, C:\java19\jdk-19.0.2\bin\javac.exe

(or whatever your path is)
 
Last edited:
Upvote 0
Top