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

Support Java 11 #341

Open
boyarsky opened this issue Nov 24, 2018 · 11 comments
Open

Support Java 11 #341

boyarsky opened this issue Nov 24, 2018 · 11 comments

Comments

@boyarsky
Copy link

This is related to #285 . Java 11 is a long term support release so more people will be switching to it than Java 9. Also the problem got worse with Java 11. The version of Java FX for Java 11 (open jfx) - https://mvnrepository.com/artifact/org.openjfx gets past the Cookie Manager class not found.

However, Java 11 moves the Robot class from com.sun.glass.ui to javafx.scene.robot. This means that you can’t just use OpenJFX’s version of JavaFX with JDK 11. And since Java FX is tied to the version of Java, you can't use the old Java 8 JavaFX jar.

This means JBrowser Driver is stuck on Java 8 until you explicitly add support for Java 11. I hope this is on the radar. This project is the only headless driver I've found for Java that doesn't require installing anything on the server. Over time, having to stay on Java 8 will become an even bigger problem.

@ArloL
Copy link

ArloL commented Dec 20, 2018

I have tried getting it to work: https://github.com/ArloL/jBrowserDriver/tree/jdk11

I am stuck that CookieManager.setDefault throws an Exception when starting the server. Eclipse also says that method is not accesible. Anyone got an idea?

@BrendM
Copy link

BrendM commented Jan 8, 2019

Any change on this? I am interested in trying this out but have to use jdk11.

@zli-ray
Copy link

zli-ray commented Jan 12, 2019

@boyarsky
Copy link
Author

boyarsky commented Jan 12, 2019 via email

@zli-ray
Copy link

zli-ray commented Jan 13, 2019

@ArloL @boyarsky
I cloned ArloL's branch : ArloL/jBrowserDriver/tree/jdk11, and tested it in my eclipse.
It seems that it works good. (I changed nothing.)

Below are my pom.xml, test code and screenshot.

pom and test code.zip

screenshot

@tatklim
Copy link

tatklim commented May 9, 2019

@ArloL @boyarsky
I cloned ArloL's branch : ArloL/jBrowserDriver/tree/jdk11, and tested it in my eclipse.
It seems that it works good. (I changed nothing.)

Below are my pom.xml, test code and screenshot.

pom and test code.zip

screenshot

@ArloL Excellent! Based on the success of @zli-ray , I have also cloned your new branch ArloL/jBrowserDriver/tree/jdk11 and then deployed a new JAR file "jbrowserdriver-1.0.2-SNAPSHOT.jar" utilizing your new XML file "pom.xml". With the new JAR, I can concur with @zli-ray that it is working for JDK 11+ based on the following 2 dependencies:

  1. [JDK 11] http://oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html
  2. [JavaFX 11] http://gluonhq.com/products/javafx

@ArloL Would you please promote the new version "1.0.2-SNAPSHOT" to production? Thank you very much!

Please note that I need to use the flag "--jbd.javaoptions" for the following 11 Java options (which must be separated by tab) for JDK 11+:
--add-exports
javafx.graphics/com.sun.glass.ui=ALL-UNNAMED
--add-exports
javafx.web/com.sun.javafx.webkit=ALL-UNNAMED
--add-exports
javafx.web/com.sun.webkit=ALL-UNNAMED
--add-exports
javafx.web/com.sun.webkit.network=ALL-UNNAMED
--add-modules=ALL-MODULE-PATH
--module-path
[the local path to JavaFX 11, for example, /usr/local/javafx-sdk-11.0.2/lib]

@tatklim
Copy link

tatklim commented May 9, 2019

@ArloL As an added bonus, I have successfully tested your new branch ArloL/jBrowserDriver/tree/jdk11 in headless mode using Monocle and can confirm it is working for JDK 11+ based on the following 3 dependencies:

  1. [JDK 11] http://oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html
  2. [JavaFX 11] http://gluonhq.com/products/javafx
  3. [OpenJFX Monocle jdk-11+26] http://central.maven.org/maven2/org/testfx/openjfx-monocle/jdk-11+26/openjfx-monocle-jdk-11+26.jar

@ArloL Would you please promote the new version "1.0.2-SNAPSHOT" to production? Thank you very much!

In headless mode, I need to use the flag "--jbd.javaoptions" for the following 13 Java options (which must be separated by tab) for JDK 11+:
-Dglass.platform=Monocle
-Dmonocle.platform=Headless
--add-exports
javafx.graphics/com.sun.glass.ui=ALL-UNNAMED
--add-exports
javafx.web/com.sun.javafx.webkit=ALL-UNNAMED
--add-exports
javafx.web/com.sun.webkit=ALL-UNNAMED
--add-exports
javafx.web/com.sun.webkit.network=ALL-UNNAMED
--add-modules=ALL-MODULE-PATH
--module-path
[the local path to JavaFX 11, for example, /usr/local/javafx-sdk-11.0.2/lib]

@sorin-costea
Copy link

Any plans to merge this?

@balazs-zsoldos
Copy link

Hi,

I updated the code to use openjfx 16 (that is compatible with JDK 11). I created a fork and released it to maven central with a different groupId. Feel free to merge back the changes to this repo.

It is available at https://github.com/everit-org/jBrowserDriver

@elect86
Copy link

elect86 commented Jul 5, 2022

@balazs-zsoldos could you share the gav coordinates?

Gotcha
implementation("org.everit.forks:org.everit.forks.com.machinepublishers.jbrowserdriver:1.1.1-jdk11.1")
but still fails with jdk11 unfortunately..

@balazs-zsoldos
Copy link

balazs-zsoldos commented Jul 11, 2022

@elect86 Works for us. However, we decided to leave jbrowserdriver behind as nobody maintains it and it does not work on Java 17. We use simple selenium webdriver instead (e.g.: chrome webdriver)

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

No branches or pull requests

9 participants