clojure-from-java | There are many ways to call Clojure from Java | Runtime Evironment library

 by   stuarthalloway Java Version: Current License: No License

kandi X-RAY | clojure-from-java Summary

kandi X-RAY | clojure-from-java Summary

clojure-from-java is a Java library typically used in Server, Runtime Evironment, Example Codes applications. clojure-from-java has no bugs, it has no vulnerabilities, it has build file available and it has low support. You can download it from GitHub.

There are many ways to call Clojure from Java

            kandi-support Support

              clojure-from-java has a low active ecosystem.
              It has 32 star(s) with 5 fork(s). There are 3 watchers for this library.
              It had no major release in the last 6 months.
              There are 2 open issues and 0 have been closed. On average issues are closed in 26 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of clojure-from-java is current.

            kandi-Quality Quality

              clojure-from-java has no bugs reported.

            kandi-Security Security

              clojure-from-java has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              clojure-from-java does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              clojure-from-java releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed clojure-from-java and discovered the below as its top functions. This is intended to give you an instant insight into clojure-from-java implemented functionality, and help decide if they suit your requirements.
            • Entry point for testing
            • Call a native library
            Get all kandi verified functions for this library.

            clojure-from-java Key Features

            No Key Features are available at this moment for clojure-from-java.

            clojure-from-java Examples and Code Snippets

            No Code Snippets are available at this moment for clojure-from-java.

            Community Discussions


            Could not locate proj/core.clj on classpath when calling clojure from java
            Asked 2021-May-08 at 15:49

            I am trying to call some Clojure code from Java, but I get this error when trying to "require" the file:



            Answered 2021-May-08 at 15:49

            Here is a full minimal working version showing Clojure called from Java.

            Project layout:



            How to include Clojure dependencies to a Java project with Maven
            Asked 2020-Jul-27 at 13:05

            I'm very new to all things JVM and want to start a Java project that involves a Clojure library as a dependency. I've seen this question on how to run Clojure code from Java, but when I try to run the jar file after mvn package, I get cannot find symbol for variable Clojure. My code looks like this so far:



            Answered 2020-Jul-24 at 21:22

            I have a working demo for you using lein to build. For the Maven part, the example project at the end.

            Using lein to build




            Calling Clojure from Java: Why is the "new" style ( better than the "old" one (gen-class)?
            Asked 2020-Jun-01 at 08:16

            Something is puzzling me after reading the this great answer to a related question:

            There are two possibilities to share a function that I wrote in Clojure with Java developers

            • The first one is providing it in a JAR file so that they can call it as if I had written it in Java. Sounds great for Clojure advocacy.

            • The second one, the purportedly better way, requires those Java developers to use things like clojure.lang.IFn or clojure.lang.RT and invoking functions by passing their names as strings (!) instead of just calling them.

            Why is the second approach "the better one"?



            Answered 2020-May-31 at 07:03

            You are sorta setting up a false dichotomy here. Every approach involves creating a jar file: that is just how JVM programs are distributed. But there are 3 different ways for Java code to invoke Clojure code contained in a jar:

            1. Use methods in clojure.lang.RT to initialize the runtime, load files, and then look up vars. This is the old, deprecated approach.
            2. Use methods in to look up functions and invoke them. This is the newer version of (1), and hides some of the messy stuff you could accidentally get wrong.
            3. Use gen-class in the Clojure library to define a more Java-friendly interface to the Clojure functions.

            You can still do (3) - there's nothing wrong with it exactly. But gen-class is a pretty clunky tool, and except for the simplest examples like exposing a number of static methods, it's just not a lot of fun, and it's not easy to provide an API that "feels" like a Java API using Clojure.

            But you know what's great at providing an API that feels like Java? Java! So what I recommend if you want to make a Clojure library easy to use in Java is to include some Java code in your Clojure library. That Java code, written by you, bridges the language gap. It accesses your Clojure code by mechanism (2) above, and presents a Java-friendly facade so the outside world doesn't have to know there's Clojure underneath.

            amalloy/thrift-gen is an example of a library I wrote years ago following this approach. It would not be at all easy to write this in pure Clojure, just because traditional Java idioms are very foreign to Clojure, and it doesn't support them all very well. By writing my own Java shim instead, Java clients get a very comfortable interface to work with, and I can just write Clojure that feels like Clojure instead of a bunch of gen-class nonsense.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install clojure-from-java

            You can download it from GitHub.
            You can use clojure-from-java like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the clojure-from-java component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer For Gradle installation, please refer .


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • HTTPS


          • CLI

            gh repo clone stuarthalloway/clojure-from-java

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link