简体   繁体   English

Java和Clojure与Leiningen合作

[英]Java and Clojure with Leiningen

Is it possible to easily manage and compile native Java classes alongside Clojure in a project using leiningen? 是否有可能在使用leiningen的项目中与Clojure一起轻松管理和编译本机Java类?

I am working at a pretty low level (with netty nio) and thinking that some of the plumbing classes would actually be easier to handle as raw java both in terms of constructing the code as well as performance. 我工作在一个相当低的水平(使用netty nio),并认为一些管道类实际上更容易处理作为原始java在构造代码和性能方面。

As of Leiningen 2.x, :java-source-path has been replaced with :java-source-paths , whose value is now specified as a vector rather than a string. 从Leiningen 2.x开始, :java-source-path已被替换为:java-source-paths ,其值现在被指定为向量而不是字符串。

A good place to find a full (up-to-date) documentation of Leiningen features is to peruse the sample project file . 查找Leiningen功能的完整(最新)文档的好地方是仔细阅读示例项目文件 In this case, you will see: 在这种情况下,您将看到:

:java-source-paths ["src/main/java"]

In Leiningen tutorial there is following statement Leiningen教程中有以下声明

For projects that include some Java code, you can set the :java-source-path key in project.clj to a directory containing Java files. 对于包含一些Java代码的项目,可以将project.clj中的:java-source-path密钥设置为包含Java文件的目录。 Then the javac compiler will run before your Clojure code is AOT-compiled, or you can run it manually with the javac task. 然后javac编译器将在您的Clojure代码进行AOT编译之前运行,或者您可以使用javac任务手动运行它。

so it should work out of box if :java-source-paths option is set 因此,如果设置了:java-source-paths选项,它应该在盒子外工作

Use Vinyasa - I wrote it especially to deal with this problem 使用Vinyasa - 我写它是为了解决这个问题

Here is a blog post Dynamic reloading of java code in emacs/nrepl 这是一篇博客文章动态重新加载emacs / nrepl中的java代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用Leiningen夹在Java之间的Clojure - Sandwiching Clojure between Java with Leiningen Java + Clojure同时开发:苹果酒没有莱宁根吗? - Simultaneous Java + Clojure development: Cider without Leiningen? 如何在leiningen中的Clojure代码之后编译Java代码 - How to compile Java code after Clojure code in leiningen 在 Leiningen (Clojure) 中为 Android 设置 JavaVersion sourceCompatibility (Java 1.7 vs 1.8) - Setting JavaVersion sourceCompatibility in Leiningen (Clojure) for Android (Java 1.7 vs 1.8) 与Leiningen一起部署Clojure应用程序 - Deploying Clojure apps with Leiningen Leiningen可以直接从Maven安装(并允许我的Clojure项目使用)Java软件包吗? - Can Leiningen install (and let my Clojure project use) Java packages directly from Maven? Leiningen使用引用Clojure文件生成的类的Java文件编译错误 - Leiningen compiling error with Java files that reference classes generated from Clojure files 使用leiningen和jenkins构建简单的clojure webproject - Build simple clojure webproject with leiningen and jenkins 在没有Leiningen的情况下将文件包含在Clojure中:找不到文件 - Including files in Clojure without Leiningen: Could not locate file clojure - leiningen 无法通过 maven 找到 deeplearning4j 工件 - clojure - leiningen could not find deeplearning4j artifact via maven
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM