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

lein lux build doesn't work (JDK9) #37

Closed
denkspuren opened this issue Oct 3, 2017 · 1 comment
Closed

lein lux build doesn't work (JDK9) #37

denkspuren opened this issue Oct 3, 2017 · 1 comment

Comments

@denkspuren
Copy link

I tried to run the "hello world" example as described in chapter 1 of the Lux book. Running lein terminated with a java.lang.ClassCastException. I guess it's because I'm using JDK9 on my computer.

C:\Users\Dominikus\Lux\myproject>lein lux build
Retrieving com/github/luxlang/lein-luxc/0.5.0/lein-luxc-0.5.0.pom from central
Retrieving org/clojure/clojure/1.6.0/clojure-1.6.0.pom from central
Retrieving com/github/luxlang/luxc-jvm/0.5.0/luxc-jvm-0.5.0.pom from central
Retrieving org/clojure/core.match/0.2.1/core.match-0.2.1.pom from central
Retrieving org/clojure/pom.contrib/0.1.2/pom.contrib-0.1.2.pom from central
Retrieving org/clojure/clojure/1.4.0/clojure-1.4.0.pom from central
Retrieving org/sonatype/oss/oss-parent/5/oss-parent-5.pom from central
Retrieving org/ow2/asm/asm-all/5.0.3/asm-all-5.0.3.pom from central
Retrieving org/ow2/asm/asm-parent/5.0.3/asm-parent-5.0.3.pom from central
Retrieving com/github/luxlang/stdlib/0.5.0/stdlib-0.5.0.pom from central
Retrieving org/clojure/clojure/1.6.0/clojure-1.6.0.jar from central
Retrieving org/clojure/core.match/0.2.1/core.match-0.2.1.jar from central
Retrieving org/ow2/asm/asm-all/5.0.3/asm-all-5.0.3.jar from central
Retrieving com/github/luxlang/luxc-jvm/0.5.0/luxc-jvm-0.5.0.jar from central
Retrieving com/github/luxlang/lein-luxc/0.5.0/lein-luxc-0.5.0.jar from central
Retrieving com/github/luxlang/stdlib/0.5.0/stdlib-0.5.0.jar from central
java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
 at leiningen.lux.utils$all_jars_in_classloader.invokeStatic (utils.clj:30)
    leiningen.lux.utils$all_jars_in_classloader.invoke (utils.clj:29)
    leiningen.lux.utils$compile_path.invokeStatic (utils.clj:66)
    leiningen.lux.utils$compile_path.invoke (utils.clj:66)
    leiningen.lux.builder$build.invokeStatic (builder.clj:8)
    leiningen.lux.builder$build.invoke (builder.clj:6)
    leiningen.lux$lux.invokeStatic (lux.clj:12)
    leiningen.lux$lux.doInvoke (lux.clj:10)
    clojure.lang.RestFn.invoke (RestFn.java:423)
    clojure.lang.Var.invoke (Var.java:383)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.core.main$partial_task$fn__5932.doInvoke (main.clj:272)
    clojure.lang.RestFn.applyTo (RestFn.java:139)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invokeStatic (core.clj:648)
    clojure.core$apply.invoke (core.clj:641)
    leiningen.core.main$apply_task.invokeStatic (main.clj:322)
    leiningen.core.main$apply_task.invoke (main.clj:308)
    leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:328)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:324)
    leiningen.core.main$_main$fn__5998.invoke (main.clj:401)
    leiningen.core.main$_main.invokeStatic (main.clj:394)
    leiningen.core.main$_main.doInvoke (main.clj:391)
    clojure.lang.RestFn.invoke (RestFn.java:421)
    clojure.lang.Var.invoke (Var.java:383)
    clojure.lang.AFn.applyToHelper (AFn.java:156)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invokeStatic (core.clj:646)
    clojure.main$main_opt.invokeStatic (main.clj:314)
    clojure.main$main_opt.invoke (main.clj:310)
    clojure.main$main.invokeStatic (main.clj:421)
    clojure.main$main.doInvoke (main.clj:384)
    clojure.lang.RestFn.invoke (RestFn.java:457)
    clojure.lang.Var.invoke (Var.java:394)
    clojure.lang.AFn.applyToHelper (AFn.java:165)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)
@denkspuren
Copy link
Author

denkspuren commented Oct 3, 2017

Did some research: The java.net.URLClassLoader is used at three places in the lux code base. It's a known problem under Java 9, as a quick search on Google reveals.

"The app classloader is no longer a URLClassLoader, so any code that assumes it is will fail.", see e.g. Source

There are "New Class Loader Implementations" says Oracle.

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