REPL [Clojure] not working on Windows 7 #299

Open
MattDMo opened this Issue Nov 24, 2013 · 13 comments

Comments

Projects
None yet
10 participants
Contributor

MattDMo commented Nov 24, 2013

I searched around the issues, and saw hints that there's a workaround for this, but couldn't find it. Any help would be appreciated :)

Platform: Win7 Ultimate x64
ST: both 2.0.2 and Build 3056
SublimeREPL: latest from Package Control
Clojure: 1.5.1
Leiningen: 2.3.4 on Java 1.7.0_45 Java HotSpot(TM) 64-Bit Server VM

If I run lein repl from the command line with some test input, I get the following:

C:\Users\mattdmo>lein repl
nREPL server started on port 51845 on host 127.0.0.1
REPL-y 0.3.0
Clojure 1.5.1
    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=> (println "Hello Clojure")
Hello Clojure
nil
user=>

However, if I start a Clojure REPL in Sublime and enter (println "Hello Clojure") it just hangs - no output, no return value, no new user=> prompt.

At the same time, if I run a Clojure REPL in OS X, it works fine. My Linux VM is borked, so I haven't been able to test it there yet.

@ghost ghost assigned wuub Nov 25, 2013

Contributor

MattDMo commented Dec 8, 2013

For what it's worth, I'm seeing the same behavior on my work laptop running XP, so it seems to be a generic Windows issue.

Contributor

MattDMo commented Dec 30, 2013

Thanks to this StackOverflow question I've been able to get Clojure working on my XP laptop. I copied Packages/SublimeREPL/config/Clojure/Main.sublime-menu to Packages/User/SublimeREPL/config/Clojure/Main.sublime-menu and changed the cmd line to the following:

"cmd": {"windows": ["lein.bat", "trampoline", "run", "-m", "clojure.main"],

I also changed the cwd to $file_path so you can open the REPL when a project.clj file is open. The results:

Retrieving org/clojure/clojure/1.5.1/clojure-1.5.1.jar from central
Clojure 1.5.1
user=> (println "Hello Clojure Trampoline!")
Hello Clojure Trampoline!
nil
user=> 

@MattDMo after adding the trampoline command, I got an error:
could not find project.clj, which is needed by trampoline

Sometimes I do not need the project.clj file in existence.

Any solutions?

Same @starrysl issue and @MattDMo workarround works great.

Also I'm having the same problem on OSX, the workaround works too.

Platforms affected:
Windows 8
Mac OSX Lion 10.7.5

Sublime Text Version:
v3 dev channel build 3061

acron0 commented Mar 25, 2015

This is still an issue. Windows 8.1, Sublime Text 3 (3080)

@ghost

ghost commented Jun 4, 2015

I have the same problem,And sublimeREPL work fine in my Ubunut 14.04 LTS,

@starrysl @kernelp4nic @acron0 @glogojava, to solve this issue i've created the project.clj which looks like this:

(defproject app "somename"
  :dependencies [[org.clojure/clojure "1.6.0"]])

and put it in C:\Clojure.

@wuub This is still somewhat of pita ... I'm running Win7 and am running into these same issues.

  • with a fresh install, invoking tools->SublimeREPL->Clojure brings it up, but as mentioned by @MattDMo it hangs on any input, eg (+ 3 3)
  • editing Main.sublime-menu now cause me to get "could not find project.clj, which is needed by trampoline" even with an open project.clj file

What else could I be missing, or where can I be looking to see what's causing the problem - I don't mind trawling through the logs, if I could just know where to find one :)

I am also running Java 1.8.0_65. I mention this only because it was fine before 1.7 got nuked from my machine.

Thanks.

This seems to work with sublime text 2, window 8.1 64, java 1.8

relevant lines from Main.sublime-menu
"cmd": {"windows": ["D:/Dev/Git/bin/bash.exe", "C:/Dev/Clojure/lein", "repl"],
and
"cwd": {"windows":"$file_path",

I installed git from here: https://git-scm.com/download/win
and downloaded the lein script from here: https://github.com/technomancy/leiningen/tree/stable/bin

Starts a repl connected to the currently open project, transfers text and so on.
If you have both git and lein in PATH, the repl command can be:
"cmd": {"windows": ["bash", "lein", "repl"],

SkReD commented Jan 14, 2016

@MattDMo @vganshin your solutions solve the problem, thanks!

@starrysl and @kernelp4nic and everyone else who's made it this far in the thread

@MattDMo is what I have working and is solid mojo

BUT - there's more!

Check out

C:\Users\yourusername.lein\profiles.clj

Mine looks like this (now)

{:user
{
:java-cmd "C:\dev\java\jdk1.8.0_65\bin\java.exe"
:plugins []
}
}

The java-cmd was torturing me because the previouse version (when lein was installed) was nuked, and replaced with the latest and no one informed lein.

#DotFilesBlow

"cmd": {"windows": ["/path/java.exe", "-cp", "/path/clojure-1.5.1.jar", "clojure.main"],

from https://zhuanlan.zhihu.com/p/19659285
I've tried and sovled this problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment