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

Two local/root jars produces incorrect classpath #77

Open
cnuernber opened this issue Jan 7, 2019 · 0 comments
Open

Two local/root jars produces incorrect classpath #77

cnuernber opened this issue Jan 7, 2019 · 0 comments

Comments

@cnuernber
Copy link

Try running lein repl with included files.
You should see sa-jdi.jar on the classpath but you will not:

issue.zip

chrisn@chrisn-dt:~/dev/tech.all/tech.jdi$ clj -R:test
Clojure 1.9.0
user=> (-> (ClassLoader/getSystemClassLoader)
(.getURLs)
(vec))
[#object[java.net.URL 0x4af0df05 "file:/home/chrisn/dev/tech.all/tech.jdi/src/"] 
 #object[java.net.URL 0x57ea113a "file:/home/chrisn/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar"]
 #object[java.net.URL 0xacdb094 "file:/home/chrisn/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar"] 
 #object[java.net.URL 0x674bd420 "file:/home/chrisn/.m2/repository/techascent/tech.resource/4.0/tech.resource-4.0.jar"] 
 #object[java.net.URL 0x2b0f373b "file:/usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar"]  
 #object[java.net.URL 0x2ceb80a1 "file:/usr/lib/jvm/java-8-openjdk-amd64/lib/sa-jdi.jar"] 
 #object[java.net.URL 0x4b45dcb8 "file:/home/chrisn/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar"] 
 #object[java.net.URL 0x7216fb24 "file:/home/chrisn/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar"]]
chrisn@chrisn-dt:~/dev/tech.all/tech.jdi$ lein repl
If there are a lot of uncached dependencies this might take a while ...
nREPL server started on port 44227 on host 127.0.0.1 - nrepl://127.0.0.1:44227
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0
OpenJDK 64-Bit Server VM 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (-> (ClassLoader/getSystemClassLoader)
  #_=> (.getURLs)
  #_=> (vec))
[#object[java.net.URL 0x68f8a35e "file:/home/chrisn/dev/tech.all/tech.jdi/test"] 
 #object[java.net.URL 0x7925497 "file:/home/chrisn/dev/tech.all/tech.jdi/src/"] 
 #object[java.net.URL 0x69ea7a84 "file:/home/chrisn/dev/tech.all/tech.jdi/src/"] 
 #object[java.net.URL 0x189aa604 "file:/home/chrisn/dev/tech.all/tech.jdi/dev-resources"] 
 #object[java.net.URL 0x35d5141a "file:/home/chrisn/dev/tech.all/tech.jdi/resources"] 
 #object[java.net.URL 0x20f6d8db "file:/home/chrisn/dev/tech.all/tech.jdi/target/classes/"] 
 #object[java.net.URL 0x1a72a81b "file:/home/chrisn/.m2/repository/org/clojure/tools.nrepl/0.2.12/tools.nrepl-0.2.12.jar"] 
 #object[java.net.URL 0x571587d7 "file:/home/chrisn/.m2/repository/clojure-complete/clojure-complete/0.2.4/clojure-complete-0.2.4.jar"] 
 #object[java.net.URL 0x4a7d2ceb "file:/home/chrisn/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar"] 
 #object[java.net.URL 0x5c5b057f "file:/home/chrisn/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar"] 
 #object[java.net.URL 0x53e65c9f "file:/home/chrisn/.m2/repository/techascent/tech.resource/4.0/tech.resource-4.0.jar"] 
 #object[java.net.URL 0x28b6420b "file:/home/chrisn/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar"] 
 #object[java.net.URL 0xb8f2982 "file:/home/chrisn/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar"]]

Running this from emacs repl I get another answer

(->> (ClassLoader/getSystemClassLoader)
           (.getURLs)
           (mapv str))
["file:/home/chrisn/dev/tech.all/tech.jdi/test"
 "file:/home/chrisn/dev/tech.all/tech.jdi/src/"
 "file:/home/chrisn/dev/tech.all/tech.jdi/src/"
 "file:/home/chrisn/dev/tech.all/tech.jdi/dev-resources"
 "file:/home/chrisn/dev/tech.all/tech.jdi/resources"
 "file:/home/chrisn/dev/tech.all/tech.jdi/target/classes/"
 "file:/home/chrisn/.m2/repository/camel-snake-kebab/camel-snake-kebab/0.4.0/camel-snake-kebab-0.4.0.jar"
 "file:/home/chrisn/.m2/repository/techascent/tech.resource/4.0/tech.resource-4.0.jar"
 "file:/home/chrisn/.m2/repository/nrepl/nrepl/0.4.4/nrepl-0.4.4.jar"
 "file:/home/chrisn/.m2/repository/clojure-complete/clojure-complete/0.2.4/clojure-complete-0.2.4.jar"
 "file:/home/chrisn/.m2/repository/org/clojure/tools.nrepl/0.2.13/tools.nrepl-0.2.13.jar"
 "file:/home/chrisn/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar"
 "file:/home/chrisn/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar"
 "file:/home/chrisn/.m2/repository/org/clojure/tools.logging/0.4.1/tools.logging-0.4.1.jar"
 "file:/home/chrisn/.m2/repository/cider/cider-nrepl/0.18.0/cider-nrepl-0.18.0.jar"
 "file:/home/chrisn/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar"
 "file:/usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar"]

It seems like the /usr/lib path is getting thrown away because it has the same root or something like that.

I noticed that leinize multimethod does not support :jar manifest type. And the classpath pathway filters it out.

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

1 participant