I've tried to install Leiningen according to the official installation instructions. When running lein repl I get the following error message:
/usr/local/bin/lein: line 315: java: command not found
This leads me to believe that Leiningen requires a JDK/JRE to actually run but there is no mention of it in the docs. So, do I first need to install a JDK/JRE?
Yes, see installation instruction https://github.com/technomancy/leiningen#installation
Yes, you need to install JDK first.
Instruction for Windows installation is here
Leinengen comes packaged as a JAR file with a small bash script wrapping it, allowing for easy command line usage. This means that, like any other clojure or java program, it require the JVM to be run.
If you take a look at ~/.lein/self-installs/ you will see the JAR file(s) leiningen utilizes to run it's tasks.
One thing worthy of noting as well is that Leiningen starts its own JVM process before creating a new JVM process for your clojure program. They are not run in the same JVM container (to enforce isolation). Also, this initial Leiningen JVM process will not close until your clojure program has finished running as well (unless you utilize the trampoline).
As always, it's worth reading through the Leiningen docs at some point to better learn about what leiningen is truly doing. Hopefully that helps... happy coding!
Related
I am trying to do heap profiling of C++ application on unix platform. I have tried valgrind's massif but it makes application very slow and affects behavior of the application.
I was searching for other options and came across gperftools and heaptrack. Though these can be viable solution for my problem here. But I have limitation here I don't enough privileges to install these tools.
Is there any way I can setup gperftools or heaptrack without installing them in unix?
Thanks in advance
You can always install things by specifying something like --prefix=$HOME/mygperftools to configure. Then it will install within your home directory.
I downloaded the Clojure jar. Its version is 1.6.0.
When I run Clojure in console I press arrow keys but they don't move the cursor but produce these characters "[[D^[[C.
I start Clojure using this command:
java -cp clojure-1.6.0.jar clojure.main
using Java 1.7.0_55 64 bit on Ubuntu 14.04 LTS 64 bit.
How can I get back normal arrow keys behaviour ?
The repl bundled with Clojure is pretty terrible. But that's okay, because you want to install Leiningen anyway, and its repl is much better, including the various readline stuff you're used to.
But in general, if there's some app that does a terrible job of being a repl, you can always use rlwrap to wrap the app in readline.
You are following hopelessly outdated instructions/tutorials. The generally accepted way to interact with all things clojure is through Leiningen. Then start Clojure by running:
lein repl
You can create a new web project by running:
lein new compojure my-project-name
or a new general project by running:
lein new my-project-name
One of the truly great things about Play and SBT is the 'hot compile' option. Makes the development workflow astoundingly productive. Does Yesod currently (or future?) have this similar ability? Thanks in advance.
There is a yesod devel command which automatically rebuilds and runs the project.
I installed clojure and clojure contrib manually, through homebrew and mac ports all of them gives me this error.
I can get other parts to work.
What gives?
edit
this question seems similar
Can not get clojure-contrib to load - FileNotFoundException
However i can load some parts, and i install through ports/brew so the versions should be in sync
It's better to use clojure & clojure-contrib not directly, but through some project, for example, managed by leiningen - it will fetch correct versions of clojure & clojure-contrib, plus some other dependencies that you're specify. You can also look onto my Lein introduction article on this topic
Well I couldn't make it work through fiddling with jars or using macport or homebrew.
But leiningen solved the problem for me.
To see the solution i came up with see:
https://github.com/khebbie/PET
also this article helped a lot:
http://pragprog.com/magazines/2011-07/create-unix-services-with-clojure
http://code.google.com/r/hectorchu-go-windows/source/list
If you could compile it successfully, I like to know the procedures of how to.
Assuming you are using Hector's source tree:
Install MinGW and MSYS, along with MSYS Bison and any other tools you think you'll find useful (vim, etc).
Install ed from the GNUWin32 project.
Install Python and Mercurial.
Clone the [hectorchu-go-windows mercurial repository](https://hectorchu-go-windows.googlecode.com/hg/ hectorchu-go-windows) to C:\Go.
Run an MSYS shell (or rxvt). The rest of these are bash commands...
mkdir $HOME/bin
export PATH=$HOME/bin:$PATH
export GOROOT=C:\\Go
export GOARCH=386
export GOOS=mingw
cd /c/Go/src
./all.bash
Correct errors as it spits them out at you, repeat step 10 until it starts building.
It's the same idea as on Linux or MacOS, basically.
However, I still stand by what I said in my comment above: this isn't necessarily going to generate anything that actually works yet. You'd be better served by waiting until this effort has merged into the main Go tree before tackling it, unless your interest is in assisting with the porting effort.
Update: there is now a mostly-functional pre-built windows port available, for those not interested in building the compiler themselves. However, given the rate of change of the project, the lack of formal releases (other than the hg "release" tag), and the possibility of Hector's changes being merged into the main branch soon, keeping up with development via source builds is likely to produce better results over time.
Just FYI, there is seems official one now.
http://code.google.com/p/go-windows/
Hector said he was only able to get as far as being able to compile and run an empty main. See issue 107:
http://code.google.com/p/go/issues/detail?id=107
There is still a lot of work to do in porting that, especially since the code has lots of dependencies on ptrace and syscall, not to mention the different threading models between Linux/BSD and Windows.
Update:
There's a new thread on golang-nuts (started 26.03.2010) with a link to a recent build and some current building instructions (using MinGW+MSYS).