“hello world”使用Netbeans 7.0 Enclojure 1.5 [英] A "hello world" using Netbeans 7.0 Enclojure 1.5

查看:115
本文介绍了“hello world”使用Netbeans 7.0 Enclojure 1.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习Clojure。我想使用Netbeans,但我不知道如何设置一个简单的应用程序吐出任何东西。我按照Enclojure插件的设置,一切似乎很好。

I just started learning Clojure. I would like to use Netbeans but I have no idea how to setup a simple app the spits out anything. I followed the setup for the Enclojure plugin and everything seems good. Can anybody give a short tutorial or a hint to one on the setup.

推荐答案

先决条件:

Netbeans 7
EnClojure Plugin
Maven set up correctly
    Maven installed
    Maven Proxy setup if behind a proxy
    Netbeans: Tools > Options > Miscellaneous > Maven

项目设置:

Menu File > New Project > Clojure > Clojure 1.2 Maven Project
Projectname= HelloWorld
Default Namespace= com.jfcorbet.helloword

浏览项目:

Projects Window > Source Packages > com.jfcorbet > helloworld.clj

您将看到:

(ns com.jfcorbet.helloworld
    ;(:import )
    ;(:require )
)

添加:

(defn hello
"Prints Hello and name parameter"
     [name]
     (println (str "Hello " name)))

(hello "Jean-François")

并保存。

现在右键单击您的项目选择Build with Dependencies,这将使Maven下载clojure和contrib库,并处理依赖关系。

Now Rightclick your project and choose "Build with Dependencies", this should make Maven download the clojure and contrib libraries, and take care of the dependencies.

然后

Rightclick your project and choose "Start Project REPL"
    Project window > helloworld.clj > RMB > choose "Load Sources in Repl"
    or select source text and RMB > "Evaluate Expr in REPL"

这篇关于“hello world”使用Netbeans 7.0 Enclojure 1.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆