2014-11-25 51 views
1

我想为Clojure使用跷跷板做一个小窗口。我使用Leiningen创建了一个“样本”项目。使用跷跷板的GUI

lein new app sample 

我在项目文件中添加了依赖关系。

(defproject sample "0.1.0-SNAPSHOT" 
    :description "FIXME: write description" 
    :url "http://example.com/FIXME" 
    :license {:name "Eclipse Public License" 
      :url "http://www.eclipse.org/legal/epl-v10.html"} 
    :dependencies [[org.clojure/clojure "1.6.0"] [seesaw "1.4.4"]] 
    :main ^:skip-aot sample.core 
    :target-path "target/%s" 
    :profiles {:uberjar {:aot :all}}) 

我的源文件如下:

(ns sample.core 
    (:gen-class) 
    (:require [seesaw.core :as seesaw] 
      [seesaw.dev :as dev])) 

(def window (seesaw/frame 
      :title "First Example" 
      :content "hello world")) 

(dev/show-options window) 

但是当我运行它,我不断收到错误:clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such namespace: dev, compiling:(C:\Users\A\sample\src\sample\core.clj:10:1)

+0

你如何运行它?我想你已经访问了一些教程,因为https://gist.github.com/daveray/1441520 – 2014-11-25 13:04:40

+0

你有AOT编译代码的原因吗?我没有看到任何需要AOT的东西。它没有AOT工作吗? – 2014-11-26 15:44:04

回答

0

我按照您的指示,它为我工作得很好,只要因为我离开了主要的定义。