`
itang
  • 浏览: 70714 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Getting Clojure running on windows

阅读更多

Getting Clojure running on windows

1 准备环境

1.1 下载相关文件

1.1.1 下载clojure 

$ wget --no-check-certificate http://github.com/downloads/clojure/clojure/clojure-1.2.1.zip

 

1.1.2 下载jline,用于Clojure REPL(交互模式)下支持line editing and history

$ wget http://downloads.sourceforge.net/project/jline/jline/1.0/jline-1.0.zip

 

1.1.3 安装Gow工具包 (可选)

 

1.2 配置

$ unzip clojure-1.2.1.zip

$ unzip jline-1.0.zip

$ cd clojure-1.2.1 && mkdir  bin 

$ cp ../jline-1.0/jline-1.0.jar bin

 

# 启动脚本

$ nodepad bin/clojure.bat

 

@echo off
rem clojure lancher shell for windows

set SCRIPT_DIR=%~dp0
rem set "CURRENT_DIR=%cd%"

if "%1" == "" goto REPL
set CP=.;%SCRIPT_DIR%/../lib/clojure.jar
java -server -Xmx792m -cp %CP% clojure.main %*

:REPL
set CP=%SCRIPT_DIR%/jline-1.0.jar;%SCRIPT_DIR%/../lib/clojure.jar
java -server -Xmx792m -cp %CP%  jline.ConsoleRunner clojure.main

:END
 

$ pwd

F:\clojure-1.2.1

 

添加环境变量 CLOJURE_HOME=F:\clojure-1.2.1

修改path变量,增加 %CLOJURE_HOME%/bin;

 

2 验证是否安装成功

重启一个命令控制台:

2.1 REPL模式

$ clojure

Clojure 1.2.1

user=> (println "Hello,World")

Hello,World

nil

user=>

  输入ctrl + d 退出

 

2.2 执行模式

$ echo (println "Hello, Clojure") > hello.clj

$ clojure hello.clj

Hello, Clojure

Clojure 1.2.1

user=> (System/exit 0)

$

 

 

注:启动脚本的一些参数设置目前都是硬编码,有时间参照scala的启动修改一下,支持windows和linux,并支持JVM参数设置

如 clojure -J-Xmx900m hello.clj

 

 

 


分享到:
评论
3 楼 itang 2011-08-02  
好吧, 用"lein repl" 挺好
2 楼 itang 2011-07-30  
https://gist.github.com/1115592
Clojure launcher for linux ,  参照Scala的改的。
1 楼 itang 2011-07-27  
看到有个 Clojure Box(http://clojure.bighugh.com/) 专门弄这个的。 只是停留在Clojure 1.2版。

相关推荐

    Professional.Clojure.1119267277

    The discussion details the read—eval—print workflow that enables fast feedback loops, then dives into enterprise-level Clojure development with expert guidance on web services, testing, datomics, ...

    Clojure电子书合集1(12本)

    [2010] Functional Programming with Clojure - Simple Concurrency on the JVM.(Tim Berglund, Matthew McCullough).[193650202X].pdf [2010] Practical Clojure - Full Introduction to Clojure, a full Lisp ...

    Programming Clojure 英文电子版

    这是Programming Clojure 电子版的 纸质版本在美国亚马逊要到2009年3月才能上架 Paperback: 200 pages Publisher: Pragmatic Bookshelf (March 15, 2009) Language: English ISBN-10: 1934356336 ISBN-13: 978-...

    clj-windows:在Windows 10上支持Clojure CLI

    适用于 Windows 的 Clojure 安装程序和 CLI 工具这是用于在 Windows 上安装 clojure CLI 工具警告Alex Miller 指出他正在开发 Windows 的官方安装程序,并要求我的项目与官方安装程序有明显区别。 见 ) 我正在这样...

    clojure eclipse

    clojure clojure clojureclojure clojure

    Practical Clojure.pdf

    Practical Clojure Clojure语言书籍

    【Clojure入门之windows环境安装】Leiningen快速手动安装指南-附件资源

    【Clojure入门之windows环境安装】Leiningen快速手动安装指南-附件资源

    Clojure编程乐趣

    Clojure is an opinionated language—it doesn’t try to cover all paradigms or provide every checklist bullet-point feature. Instead it provides the features needed to solve all kinds of real-world ...

    clojure相关书籍1

    【1】[Clojure编程乐趣](The Joy of Clojure).pdf 【2】Clojure – Functional Programming for the JVM中文版.pdf 【3】Clojure Cookbook.pdf 【4】Clojure Data Analysis Cookbook.pdf 【5】clojure Hand book...

    Clojure编程乐趣(英文版)

    Clojure编程乐趣(英文版),对学习Storm有很大的帮助,值得看。

    The Joy of Clojure, 2nd Edition

    The Clojure programming language is a dialect of Lisp that runs on the Java Virtual Machine and javascript runtimes. It is a functional programming language that offers great performance, expressive ...

    Clojure电子书合集2(13本)

    [2013] Functional Programming Patterns in Scala and Clojure - Write Lean Programs for the JVM.(Michael Bevilacqua-Linn).[1937785475].pdf+epub.rar [2014] Clojure Cookbook - Recipes for Functional ...

    Clojure编程乐趣]+clojure_programming.pdf

    Clojure编程乐趣和clojure_programming.pdf两本书

    Clojure可选类型系统TypedClojure.zip

    Typed Clojure 保留了 Clojure 的优势,是 Clojure 的可选类型系统,也可以说是 Clojure 的一个库,改善了大量的静态类型安全检测。主要特性:从 Java 中保护你的 Clojure 程序,进行安全的互操作,正确的使用外部 ...

    clojure相关书籍2

    【5】Programming Concurrency on the JVM(Java虚拟机并发编程)(英文版).pdf 【6】programming_clojure_2nd_edition.pdf 【7】Storm实时数据处理.pdf 【8】The Joy of Clojure(Thinking the Clojure Way ).pdf ...

    clojure1.3.0及资料

    clojure1.3.0及资料,附《Programming Clojure》,《Practical Clojure》

    Clojure Data Analysis Cookbook

    Clojure Data Analysis Cookbook

    Clojure Applied(Pragmatic,2015)

    Once you're familiar with Clojure, take the next step with extended lessons on the best practices and most critical decisions you'll need to make while developing. Learn how to model your domain with...

    Mastering.Clojure.1785

    Learn to handle data using sequences, reducers, and transducers in Clojure Explore the lesser known and more advanced features, constructs, and methodologies of the Clojure language and its ecosystem,...

Global site tag (gtag.js) - Google Analytics