-
Notifications
You must be signed in to change notification settings - Fork 10
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
Polylith says I have $CLASSPATH set even though it is not #16
Comments
The warning mentioned in the issue is not printed by the Polylith plugin, it's printed by Leiningen itself as you can see here in its source code. You should see the same error if you try to run any other commands using Leiningen. Leiningen prints this warning if you have an environment variable named $CLASSPATH. Try to see if you have it by running this command on your terminal:
I'm closing this issue since it's not related to Polylith plugin. |
Please take a look at the command log from my original post, I did exactly as you suggested and showed that it is not an issue with my classpath:
Thanks for telling me that this comes from lein though! That makes understanding the problem a lot easier. I had a dig around in the I injected the following code into (defn print-inner-sh-classpath []
(->> (shared/sh "env")
(str/split-lines)
(filter #(str/includes? % "CLASSPATH"))
println)) And sure enough it prints the following: (CLASSPATH=/home/miridius/.lein/self-installs/leiningen-2.8.1-standalone.jar) This is the classpath that the You can reproduce the issue really simply on Linux like this: $ lein repl
nREPL server started on port 46861 on host 127.0.0.1 - nrepl://127.0.0.1:46861
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
OpenJDK 64-Bit Server VM 1.8.0_181-8u181-b13-1ubuntu0.18.04.1-b13
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=> (require '[clojure.java.shell :as shell])
nil
user=> (shell/sh "lein" "version")
{:exit 0, :out "WARNING: You have $CLASSPATH set, probably by accident.\nIt is strongly recommended to unset this before proceeding.\nLeiningen 2.8.1 on Java 1.8.0_181 OpenJDK 64-Bit Server VM\n", :err ""} |
Thank you @miridius for investigating this more. Here are my thoughts on the issue after spending several hours on it. I've tried it with several Linux versions and with different Oracle and OpenJDK versions, it seems to be like the issue happens on Linux regardless of distribution or JVM. I've also tried to find a clue why Leiningen does not include Even though I still think this is not something we should solve within the Polylith plugin, since it is not a problem/bug caused by the plugin. Although, we need to handle the issue until the real issue is found either in Leiningen, JVM, or Clojure, or maybe somewhere else I can't think of now. I'm also hesitant about adding/fixing things within the code without knowing the exact reason of the problem. We might introduce more problems as well in the future. P.S. I've also found an example about What do you think about this @tengstrand and @Misophistful? I would like to hear your thoughts about this particular issue. |
Describe the bug
Any time I run any polylith command in any project, it says "WARNING: You have $CLASSPATH set, probably by accident. It is strongly recommended to unset this before proceeding.", but I do not have this variable set.
To Reproduce
Expected behavior
The $CLASSPATH error does not show false positives, or, if something is actually wrong it explains the real issue.
Operating System (please complete the following information):
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: