This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-05
Channels
- # babashka (4)
- # bangalore-clj (1)
- # calva (5)
- # chlorine-clover (1)
- # cider (5)
- # clara (9)
- # clj-kondo (18)
- # cljs-dev (12)
- # clojure (42)
- # clojure-europe (9)
- # clojure-norway (1)
- # clojure-uk (4)
- # clojured (255)
- # clojurescript (76)
- # community-development (3)
- # conjure (4)
- # emacs (9)
- # figwheel (3)
- # fulcro (6)
- # graalvm (6)
- # java (15)
- # lsp (7)
- # luminus (1)
- # off-topic (5)
- # pathom (9)
- # reagent (5)
- # ring (6)
- # shadow-cljs (38)
- # sql (21)
- # xtdb (12)
Hi, does anyone know of a good leinengen template that generates a Java class? I want to create a class that I can import in a Java project
Why would you use Leiningen to create a Java class?
I’d like to use leiningen to create a project that produces compiled Java classes easily so that I can understand AOT better and so that I can see an example of modern best practices around AOT etc
Sorry for being vague
@danielmartincraig So you want to create a Clojure project that is using :gen-class
to produce Java classes? (sorry but this just seems like a strange expectation)
Yes I do
I would like to call Clojure from Java. I guess that’s not very commonly done?
I was just hoping there was a modern example of how to do this in the modern landscape of Clojure tools
if you're building for Java consumption, my strong recommendation is to write the interface you want in Java (using only Java interfaces)
I guess I’m just not sure why you think there would be a Leiningen template for this…
that way you get the types you want, and the docstrings you want, etc
then implement those interfaces mostly in Clojure and use a small bit of the Clojure Java API to bootstrap https://clojure.github.io/clojure/javadoc/
Ok thanks for the great help!