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

IllegalAccessException on Java 11 #10

Open
stuarthalloway opened this Issue Dec 10, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@stuarthalloway
Copy link
Contributor

stuarthalloway commented Dec 10, 2018

  1. Download JavaFX manually from https://openjfx.io/openjfx-docs/#install-javafx and unzip the .tgz

  2. Add extra deps to :extra-deps

:extra-deps
{com.cognitect/rebl          #:local{:root "REBL-0.9.109.jar"}
 org.openjfx/javafx-fxml     #:local{:root "/Users/xxx/javafx-sdk-11.0.1/lib/javafx.fxml.jar"}
 org.openjfx/javafx-controls #:local{:root "/Users/xxx/javafx-sdk-11.0.1/lib/javafx.controls.jar"}
 org.openjfx/javafx-swing    #:local{:root "/Users/xxx/javafx-sdk-11.0.1/lib/javafx.swing.jar"}
 org.openjfx/javafx-base     #:local{:root "/Users/xxx/javafx-sdk-11.0.1/lib/javafx.base.jar"}
 org.openjfx/javafx-web      #:local{:root "/Users/xxx/javafx-sdk-11.0.1/lib/javafx.web.jar"}
 }
  1. Add extra :jvm-opts
:jvm-opts    ["--module-path" "/Users/xxx/javafx-sdk-11.0.1/lib" "--add-modules=javafx.web,javafx.fxml,javafx.swing,javafx.base,javafx.controls"]

After all of that, it will now load properly. However, still getting this exception and I can't figure it out, although the data still displays in plain text:

2018-12-07 11:38:20,882 [JavaFX Application Thread] ERROR xxx.core - Uncaught exception on JavaFX Application Thread
java.lang.IllegalAccessException: class clojure.lang.Reflector cannot access class com.sun.webkit.dom.NodeListImpl (in module javafx.web) because module javafx.web does not export com.sun.webkit.dom to unnamed module @569c9762
	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
	at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591)
	at java.base/java.lang.reflect.Method.invoke(Method.java:558)
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:167)
	at clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:387)
	at cognitect.rebl.fx$get_elements.invokeStatic(fx.clj:271)
	at cognitect.rebl.fx$get_elements.invoke(fx.clj:268)
	at cognitect.rebl.fx$set_webview$reify__11775.changed(fx.clj:294)

Originally posted by @kanwei in #7 (comment)

@puredanger

This comment has been minimized.

Copy link
Contributor

puredanger commented Dec 11, 2018

I tried this process as follows:

  1. Installed Java 11
  2. Downloaded and expanded javafx-sdk-11.0.1 to /Users/alex/Downloads/REBL-0.9.109
  3. Used the following deps.edn file:
{:deps {}
 :aliases
 {:rebl
   {:extra-deps
     {org.clojure/clojure {:mvn/version "1.10.0-RC2"}
      org.clojure/core.async {:mvn/version "0.4.490"}
      com.cognitect/rebl {:local/root "/Users/alex/Downloads/REBL-0.9.109/REBL-0.9.109.jar"}
      org.openjfx/javafx-fxml     #:local{:root "/Users/alex/code/javafx-sdk-11.0.1/lib/javafx.fxml.jar"}
      org.openjfx/javafx-controls #:local{:root "/Users/alex/code/javafx-sdk-11.0.1/lib/javafx.controls.jar"}
      org.openjfx/javafx-swing    #:local{:root "/Users/alex/code/javafx-sdk-11.0.1/lib/javafx.swing.jar"}
      org.openjfx/javafx-base     #:local{:root "/Users/alex/code/javafx-sdk-11.0.1/lib/javafx.base.jar"}
      org.openjfx/javafx-web      #:local{:root "/Users/alex/code/javafx-sdk-11.0.1/lib/javafx.web.jar"}}
   :jvm-opts ["--module-path" "/Users/alex/code/javafx-sdk-11.0.1/lib" "--add-modules=javafx.web,javafx.fxml,javafx.swing,javafx.base,javafx.controls"]}}}

Started with:

clj -A:rebl -m cognitect.rebl

And everything worked. I did not see any illegal access warnings or errors.

@kanwei

This comment has been minimized.

Copy link

kanwei commented Dec 11, 2018

Hey @puredanger, seems like you were able to reproduce it, but to clarify, the exception only occurs after clicking on the "Welcome to REBL." in the bottom left panel.

@puredanger

This comment has been minimized.

Copy link
Contributor

puredanger commented Dec 11, 2018

Yep, thanks. Fix is in Clojure 1.10.0-RC5.

@stuarthalloway

This comment has been minimized.

Copy link
Contributor

stuarthalloway commented Dec 14, 2018

Hi @kanwei,

If you can confirm the fix on your end I will close this.

Thanks for the report!

@kanwei

This comment has been minimized.

Copy link

kanwei commented Dec 14, 2018

Looks like it's working on clojure 1.10.0-RC5. Thanks!

@MageMasher

This comment has been minimized.

Copy link

MageMasher commented Dec 14, 2018

In order to get this to work on my mac I had to add all the javafx modules, not the subset in the initial post of this issue.

           :rebl
           {:extra-deps {org.clojure/clojure {:mvn/version "1.10.0-RC5"}
                         com.cognitect/rebl {:local/root "/Users/jlane/programming/tools/REBL-0.9.109/REBL-0.9.109.jar"}
                         stuarthalloway/reflector {:git/url "https://github.com/stuarthalloway/reflector" :sha "58565dda87195478843d7cfdb71371ed29a573bd"}
                         org.clojure/core.async {:mvn/version "0.4.490"}
                         org.openjfx/javafx-fxml     #:local{:root "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib/javafx.fxml.jar"}
                         org.openjfx/javafx-controls #:local{:root "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib/javafx.controls.jar"}
                         org.openjfx/javafx-swing    #:local{:root "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib/javafx.swing.jar"}
                         org.openjfx/javafx-base     #:local{:root "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib/javafx.base.jar"}
                         org.openjfx/javafx-media #:local{:root "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib/javafx.media.jar"}
                         org.openjfx/javafx-graphics #:local{:root "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib/javafx.graphics.jar"}
                         org.openjfx/javafx-web      #:local{:root "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib/javafx.web.jar"}}
            :jvm-opts ["--module-path" "/Users/jlane/programming/git_repos/javafx-sdk-11.0.1/lib" "--add-modules=javafx.web,javafx.fxml,javafx.swing,javafx.base,javafx.controls,javafx.graphics,javafx.media"]}
@puredanger

This comment has been minimized.

Copy link
Contributor

puredanger commented Jan 3, 2019

As of the latest version of clj (1.10.0.408), you can use Java 11, Clojure 1.10, and javafx via deps without any issues.

{:deps {}
 :aliases
 {:rebl
   {:extra-deps
     {org.clojure/clojure {:mvn/version "1.10.0"}
      org.clojure/core.async {:mvn/version "0.4.490"}
      com.cognitect/rebl {:local/root "/Users/alex/Downloads/REBL-0.9.109/REBL-0.9.109.jar"}
      org.openjfx/javafx-fxml     {:mvn/version "11.0.1"}
      org.openjfx/javafx-controls {:mvn/version "11.0.1"}
      org.openjfx/javafx-swing    {:mvn/version "11.0.1"}
      org.openjfx/javafx-base     {:mvn/version "11.0.1"}
      org.openjfx/javafx-web      {:mvn/version "11.0.1"}}}}}
clj -R:rebl -m cognitect.rebl
@MageMasher

This comment has been minimized.

Copy link

MageMasher commented Jan 7, 2019

Hey @puredanger , I think there is a typo in your last codeblock.
clj -R:rebl -m cognitect.repl => clj -R:rebl -m cognitect.rebl

@puredanger

This comment has been minimized.

Copy link
Contributor

puredanger commented Jan 7, 2019

Yep, sorry - changed

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