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

Gorilla and Java 10 #13

Open
peter-lyons-kehl opened this issue Sep 3, 2018 · 2 comments
Open

Gorilla and Java 10 #13

peter-lyons-kehl opened this issue Sep 3, 2018 · 2 comments

Comments

@peter-lyons-kehl
Copy link

Dear Jony,

Thank you for Gorilla.

Sadly, SUN/Oracle's Java 10 doesn't like it. From below it sounds not Gorilla-specific, but this seems to be the place to report.

# SUN's java version "10.0.1" 2018-04-17 on 64bit SUSE
# The problem probably also exists with OpenJDK 10. However, OpenJDK has more issues (it can't run lein at all).
lein new app playground
cd playground
# edit project.clj to add :plugins [[lein-gorilla "0.4.0"]] and :jvm-opts ["--add-modules" "java.xml.bind"]. See below for why :jvm-opts. After editing, project.clj is:
(defproject playground "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.8.0"]]
  :main ^:skip-aot playground.core
  :target-path "target/%s"
    :plugins [[lein-gorilla "0.4.0"]]
    :jvm-opts ["--add-modules" "java.xml.bind"]
  :profiles {:uberjar {:aot :all}})

# To double-check, this should be an alternative to the above Ljvm-opts, but it didn't help either:
export  JAVA_TOOL_OPTIONS="-Djdk.launcher.addmods=java.xml.bind"

#Gorilla fails:
lein gorilla
Picked up JAVA_TOOL_OPTIONS: -Djdk.launcher.addmods=java.xml.bind
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(org/httpkit/server.clj:1:1)
 at clojure.lang.Compiler.load (Compiler.java:7391)
    clojure.lang.RT.loadResourceScript (RT.java:372)
...

Related, applied above but it didn't fix this for Java 10: bhauman/lein-figwheel#612.
The class should exist in Java 10: https://docs.oracle.com/javase/10/docs/api/javax/xml/bind/DatatypeConverter.html.

Please help.

@peter-lyons-kehl
Copy link
Author

As explained at https://stackoverflow.com/questions/51466464/clojure-gorilla-repl-and-jvm-10-exception, :jvm-opts and dependencies don't apply to plugins. What helped was

:plugins [[javax.xml.bind/jaxb-api "2.3.0"]
         [lein-gorilla "0.4.0"]])

The above is most likely also covered by #12.

However, that switched the problem to the same as with OpenJDK 10: ClassNotFoundException: sun.misc.Launcher. (Related: technomancy/leiningen#2149 but it doesn't give any advice.)

@ksseono
Copy link

ksseono commented Sep 14, 2020

@peter-kehl You might want to try with this: https://github.com/benfb/lein-gorilla/releases/tag/v0.7.0

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