Wow installing Leiningen is a giant hassle
Why isn't this easier?
(That's mostly a rhetorical question, though I'm sure there are Reasons)
If your need is not too advanced, you should maybe consider replacing Leiningen with the more recent CLI tools
Thank you! Such as?
you can install the new clj
scripts through your package manager
"Installation on Windows Not yet available - see Leiningen or Boot instead."
Am I looking at the right place?
ah — if you’re on windows then things will be a bit awkward to do
there’s not great support for windows I’m afraid
Yeah... I have an environment set up on my Mac, but that's a work machine and I'll be giving it back soon. My own laptop is Windows.
I know support for windows is coming for clj
, lein
already does support it tho
how are you finding installing lein
a pain?
should be just a matter of fetching a script and running it
You think I know how to do either of those things?
This is why the beginners channel felt advanced to me
surely you know how to download a file from your browser?
I've downloaded a file.
I downloaded a JDK file, installed it, and downloaded a Leiningen file, which says it can't detect the JDK file
Then if I try to manually select the location where the JDK file is, I get a runtime error saying "Out of Range"
select from what?
I can't get that far, unfortunately... in the tutorial it shows a list of radio button options with 'Custom' at the bottom. Mine shows only 'Custom' and when I click on it I get the runtime error
I don’t know what tutorial you’re talking about so I have no idea what you’re refering to
yeah ignore that
it’s old and unmaintained
Right...
But going to the Leiningen page direct gives me nothing to download, just a text file
Or a page of text, I should say
so as a first step you need to make sure you have a jdk installed — https://www.ntu.edu.sg/home/ehchua/programming/howto/JDK_HowTo.html follow steps 1 to 4 of “How to install jdk on windows”
I definitely have that, so all good
can you open a terminal and type java -version
and paste the output here?
java version "9.0.4" Java(TM) SE Runtime Environment (build 9.0.4+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)
should output something like
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
Yep, as above
ok
download https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat this file then
support for 1.9 is flakey ATM...isn't it
nah
It's a page of text - how do I download it?
File -> Save as
Save As a text document?
yes
okay
I've done that
cool, now you have leiningen available — just open a terminal and type path/to/lein.bat
(where path/to
matches the directory where you downloaded lein)
It's just in downloads right now, I guess I need to put it somewhere else
I have no idea how to set the global PATH in windows — somebody else that uses windows might be more helpful — but as a first step you could try just putting it in C:\
and invoking C:\lein.bat
from the terminal
that said
I would recommend you started with something like https://sekao.net/nightcode/ instead
Oh, that looks ideal!
no need to set up your env at all
Okay, putting those path commands into my terminal didn't work anyway, I'll download this with fingers crossed
Thank you for all your help 🙂
all this stuff is way easier to do on a linux or osx machine FYI
there’s not many people using clojure on windows
Why is that?
well, for various reasons unless you’re programming for Windows in e.g. .NET languages, people prefer unix environments to program
the new clj
stuff should make all this much less painful but it’s relatively recent and windows support is still a work in progress
better terminal, better integration with most programming tools (git!), more reasonable over all 😛
You can use something like https://c9.io to get a linux environment in the browser (it's free)
This is getting more and more complicated...
just stick to nightcode for now
Thank you
Although I've only started it up and already got an error message...
"Cannot run program "java" (in directory "."): CreateProcess error=2, The system cannot find the file specified"
eh, that looks like the same issue you had with installing leiningen
from that setup file, which suggests your JDK is either not set up properly or you haven’t selected the proper path
Okay, I'll take a look... I just installed the JDK and left it at default settings and didn't select anything manually in installing Nightcode, I'll have to dig and see what I can do.
The barrier to entry to just getting access to Clojure is so much higher than I thought.
again, this is unfortunately because of your using Windows.. compare with installing lein and jdk on e.g. ubuntu (linux) sudo apt-get install openjdk-8-jre-headless leiningen
you could try following this guide
Thank you, I'll give it a go
I'm not in a tiny minority here or anything though - Macs are expensive and I associate Linux with needing knowledge to make it work. Maybe that's wrong, but I'm pretty sure I'm not some outlier. I hope it gets easier to use soon, I like Clojure and want to recommend it to other friends trying to learn this stuff.
Ubuntu is easy
if you just want to start playing with clojure then https://repl.it/repls/UglyTrustyLivecd
@amelia windows developer for the JVM are definitely a minority, some Linux distros are as simple as osx or windows to use nowadays. This is not to say that it should be hard to start working with clojure on windows, but unfortunately a good first experience with windows has never been a priority
does Lein provide a jar? i'm running Boot on my Windows laptop like so: java -jar "%HOME%\Downloads\bin\boot.jar"
it does but the bash script is quite useful
Took a break, restarted Nightcode and it works now! Thanks for the help, everyone.
Nothing for Windows, unfortunately
@amelia ah yeah too bad 😕 back to Leiningen then. I've heard rumor that the CLI tools will be available for windows soon though: https://www.reddit.com/r/Clojure/comments/81yk2a/clojurescript_110x_new_quick_start_feedback/dv6k18r/
Fingers crossed it's a better experience soon...
@amelia what's your use case for Leiningen? If you just want to set up an environment for learning the language, maybe you can use Nightcode (https://sekao.net/nightcode/), it's designed to provide an out-of-the-box experience
@amelia after you go through this first moments with Clojure (so you are not overloaded), consider installing a distribution of Linux in a part of your computer. The process is straightforward (grab an empty pendrive, download a Linux image and download a program to install that Linux image on your pendrive, reboot with pendrive connected) and you will still have you comfy Windows, but will also be able to boot up a Linux machine and, I sincerely believe, you will not only love the experience (it's cleaner and easier to use, in my not so humble opinion) but it will make your developer life a lot easier. If you ever decide to do this, and you need help, feel free to ask me, or, well, any other Linuxer. We love bringing people to the dark side.
That's where the advice in the main thread ended up too 🙂 Thanks!
Thank you 🙂 Honestly, I'm a little frustrated by the fact that you need to change something so fundamental to make such a positive difference - it's less inclusive than I was expecting. But I'm taking this seriously, and if it'll help then I'll give it a try.
if you want to know why this is, this section of an essay by a programming luminary details some of the reasons (it's the essay that first led me to programming): http://www.catb.org/esr/faqs/hacker-howto.html#skills2. it's opinionated, but informative.
depending on which Windows version you're on, you may be able to use this instead of having to install Linux from scratch: https://docs.microsoft.com/en-us/windows/wsl/about
i have a programmer friend who uses Windows, and he uses that subsystem to get access to the same tools that Linux users have
Thanks @sundarj, that essay is really interesting! I want to hold off on doing anything more complicated just yet - I don’t even know if I’ll still be using Clojure in a month, let alone long enough to justify the kinds of changes being suggested here. I just want to play with Clojure for a while and see if I like it.
@amelia oh, of course! stick with what you have now and just keep playing. above all it's important to have fun! by all means take things slowly; didn't mean to suggest you needed to rush into such a big change 🙂 just wanted to (try to) ameliorate any confusion you might have had, and suggest an easier path to Linux for if/when in the future, you felt like giving it a go
Definitely a job for another day though - now I'm set up I just want to play with some code for a bit and remember why I like it...
Absolutely. Have fun with what your current setup, even to understand its limitations, which is important. People use Linux and Mac to develop in Clojure because Unix systems are better suited to the task and provides the programmer with more control over the OS. So don't feel frustrated, it's a long and boring war. Clojure just happened to exist in this side of the fence, so Windows is left with not that great support. But the same is true if you try to program in Node on Windows, or run Docker. Windows started embedding a Linux kernel in recent PRO versions, can you imagine? Even Microsoft realized that in order to become a suitable OS for developers, they had to embrace the way people do it on Linux. Well, again, have fun and don't hesitate to ask.