Has anyone ever seen problems like this with compile
on Windows?
user=> (require 'puget-cli.main)
nil
user=> (compile 'puget-cli.main)
Unexpected error (IOException) macroexpanding clojure.core/gen-class at (puget_cli\main.clj:1:1).
The system cannot find the path specified
oh crap, this is because the classes
dir doesn't exist probably
yeah
ok, it worked now: https://github.com/borkdude/puget-cli
Amazing. Once you have regular releases, at least prereleases, let me know. I'm going to package it. Looks great ❤️
Sure. I'll await some feedback and once I'm fairly certain it's good to go, I'll let you know
Hi!
I installed cli tools on Windows 10 folloing the official docs and I have a rather weird result:
clj -h
runs ok but clj
raises an error:
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
@gr.evocatus What does clojure -Sdescribe
show you?
{:version "1.10.1.697"
:config-files ["C:\Users\Рома\Documents\WindowsPowerShell\Modules\ClojureTools\deps.edn" "C:\Users\Рома\.clojure\deps.edn" "deps.edn"]
:config-user "C:\Users\Рома\.clojure\deps.edn"
:config-project "deps.edn"
:install-dir "C:\Users\Рома\Documents\WindowsPowerShell\Modules\ClojureTools"
:config-dir "C:\Users\Рома\.clojure"
:cache-dir "C:\Users\Рома\.clojure\.cpcache"
:force False
:repro False
:main-aliases ""
:repl-aliases ""
:exec-aliases ""}
Is there a deps.edn
in the folder in which you are running clj
? If so, what is in it?
Also, could you confirm that when you run clj -h
, this is what you see:
$ clj -h
Version: 1.10.1.697
You use the Clojure tools ('clj' or 'clojure') to run Clojure programs
on the JVM, e.g. to start a REPL or invoke a specific function with data.
The Clojure tools will configure the JVM process by defining a classpath
(of desired libraries), an execution environment (JVM options) and
specifying a main class and args.
(and a bunch more stuff, including all the options)
Could you try clojure -Sforce -r
and let me know whether that produces a basic REPL or gives an error?
If the help from clj -h
doesn't look like the above and the clojure -Sforce -r
command produces a REPL, then I think you may have a rogue clj
script that is hiding the official script. There used to be an old, unofficial clj
script that some people installed.
No, there is no deps.edn in the folder I run clj
in. And clj -h
output starts exactly like you wrote.
clojure -Sforce -r
gives an error
WARNING: When invoking clojure.main, use -M
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
Sorry, I've no idea. Perhaps uninstall it and use scoop
to install it instead? (per the instructions at the bottom of that clj-on-window wiki page)
I'll be honest, when I got my new Win10 laptop, I gave up on Powershell and instead installed WSL2 and Ubuntu and I have all my Clojure dev env on Linux (using brew
aka linuxbrew
)
Quoting arguments is really messy on Powershell -- and all the tutorials and instructions out there really assume macOS or Linux, so it really is a lot easier to just use WSL2 for Clojure work on Windows.
And if you install VcXsrv (Xlaunch) then you can run Linux apps with GUIs and they run just fine: I have Atom installed on WSL2 and use it running via Xlaunch for all my editing, with Reveal for visualizing data, also launched from WSL2 and running via Xlaunch.
Thanks for your help anyway
The latest version on https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows is 1.10.1.727 so you could try installing that I guess. Looks like the instructions have changed since I last tried PS