-
-
Save camsaul/c982019fd915510677236cd4b720a583 to your computer and use it in GitHub Desktop.
| #!/bin/bash | |
| JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home lein run |
lein version to double-check JAVA_HOME worked correctly
Use Java 8:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_141.jdk/Contents/Home lein run
# to run things like JARs
alias java=$JAVA_HOME/bin/javaNote : I couldn't use JAVA_HOME, had to use JAVA_CMD
JAVA_CMD=/home/jerome/bin/jdk1.8.0_131/bin/java lein -v
Leiningen 2.9.1 on Java 1.8.0_131 Java HotSpot(TM) 64-Bit Server VM
@jprudent I've been using Jabba (https://github.com/shyiko/jabba) for this stuff now
Is it possible to set JVM version per project, for example via project.clj?
Edit: I discovered how to do this with jEnv, using jenv local <jvm-version> within my project directory. I suppose that does the trick! Although it would still be useful to do this in project.clj, add to source control, etc.
Is it possible to set JVM version per project, for example via
project.clj?
you can, add
:java-cmd "/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java"
to your project.clj, or the path of whatever other java binary you are using
Actually apparently OpenJDK is already included here:
So: