@seancorfield Can you run $env:PSModulePath
from a PowerShell window and confirm that C:\Users\sean\Documents\WindowsPowerShell\Modules\
is in there? I got the same error you did intially but had cloned into the wrong dir. Yours doesn't look wrong, but maybe your module path is different.
PS C:\Users\sean> $env:PSModulePath \\Mac\Home\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\
PS C:\Users\sean>
Interesting. I'm on a Parallels VM so it's shadowing my actual, local Documents folder... just a sec...Ah, and I can't run modules from that mounted file system apparently:
PS C:\Users\sean\clojure\cool> Import-Module ClojureTools
Import-Module : File \\Mac\Home\Documents\WindowsPowerShell\Modules\ClojureTools\ClojureTools.psm1 cannot be loaded
because running scripts is disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module ClojureTools
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Import-Module], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand
PS C:\Users\sean\clojure\cool>
You'll want to run Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
. I'll add that to the README
Progress but
PS C:\Users\sean\clojure\cool> cat .\deps.edn
{}
PS C:\Users\sean\clojure\cool> clj
Error building classpath. Error reading edn. Map literal must contain an even number of forms (C:\Users\sean\clojure\cool\deps.edn)
Get-Content : Cannot find path 'C:\Users\sean\clojure\cool\.cpcache\E5871DE60E3205214DC08C277D9BF25A.cp' because it
does not exist.
At \\Mac\Home\Documents\WindowsPowerShell\Modules\ClojureTools\ClojureTools.psm1:290 char:11
+ $CP = Get-Content $CpFile
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\sean\c...8C277D9BF25A.cp:String) [Get-Content], ItemNotFoundEx
ception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
sure looks like a valid deps.edn
to me... 👀
interestng
Just tested from Windows PowerShell and PowerShell Core. Both of my work with a deps.edn
only containing {}
. Maybe try clj -Sdescribe
If I remove that deps.edn
, it runs and gives me the expected output.
weird
If I cd
off to another directory that contains a deps.edn
, it works.
so just the empty map one causes a problem?
No, empty maps in other folders are fine.
curiouser and curiouser
And when I copied in an empty deps.edn
from somewhere else it worked. Must have been some bogus character in that file.
How did you create it?
If it was via PowerShell, it could have ended up in UTF-16
Ah, yes, via echo
.
Like I would on Linux 🙂
haha, right
Luckily PowerShell core defaults to UTF-8
Copied in my dot-clojure file from Linux and all that seems to be working... cool...
Now I guess I should install OpenJDK11 and test REBL running here 🙂
Most of my tests were cribbed from your deps.edn example, so hopefully I caught some of your common ones. Didn't try REBL yet though.
clj -A:liquid
works (and pops open a new window for editing) so that's pretty cool 🙂
Success!
clj -A:new
works to create a new project. So far, so good.
@ajoberstar I just went through the steps on my Windows 10 laptop (so it's native Windows, not a VM).
Import-Module
seemed to go smoothly, but whenever I run clj
or clojure
, the PS window quits.
Trying pulling down the latest commits. I noticed that the exits ported over from the bash were quitting PS, so changed them to returns.
'k ... just a sec ...
I have the very latest from Git
I literally just cloned it
But I did a git pull
just to check -- already up to date
OK, let me double check what I have out there on master
Updated a day ago it says 🙂
hmm, is the latest commit c9a6a580ed1a22d58af833b4b9895aca97b0b755
Should be 3 hours ago
It does look like I missed a couple exits, will get something pushed up for that
Oh, my bad. Yeah, 3 hours ago 🙂
ok pushed
Ah, I don't have Java installed so that would cause the 'exit'.
If I git pull
the repo, do I need to re-import the module?
yeah, make sure you include -Force
at the end too
I didn't re-import but it just worked
PS C:\var\www> clj
Couldn't find 'java'. Please set JAVA_HOME.
PS C:\var\www>
I have Java on WSL on this machine but not natively on Windows. Doh!
I don't fully understand when re-import is required, but it seems to be more often than not, so that's just been my habit.
I definitely like having WSL around, but very much looking forward to not having to go there for clojure
Heads up that I probably won't get a chance to work on this again till mid-next week. But if anyone has additional feedback, please pass it along.
It'll be nice to have REBL running on Windows...
nice work @ajoberstar and @seancorfield thx as always, feel free to send me patches, even if partial
I can do builds and put them on our download cdn for people to try whenever
even if not "done"
Nice. REBL up and running natively on Windows, on OpenJDK11!
!!
Now I'm working on clojure.java.jdbc
in Atom with Chlorine connected to a Socket REPL server running inside REBL, and evaluating forms from the editor into REBL's inspector 🙂
Side-by-side, ctrl-, i
to "inspect" a form from Atom into REBL.
(excuse the narrow windows -- this is on a tiny laptop)
sweet!
@ajoberstar Am I right that it doesn't support the equivalent of CLJ_CONFIG=<path> clojure ...
at the moment?
It looks like you unconditionally set $ConfigDir
to the user .clojure
folder, without allowing it to be overridden. We rely on being able to override that for our work projects.
I can open an issue on your repo if you want, for tracking?