This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-18
Channels
- # aws (21)
- # babashka (32)
- # babashka-sci-dev (3)
- # beginners (17)
- # biff (1)
- # calva (8)
- # clj-kondo (1)
- # cljfx (8)
- # cljs-dev (3)
- # clojure (13)
- # clojure-belgium (1)
- # clojure-europe (16)
- # clojure-losangeles (2)
- # clojure-norway (6)
- # clojurescript (11)
- # conjure (1)
- # data-science (1)
- # fulcro (2)
- # gratitude (5)
- # helix (1)
- # joyride (3)
- # malli (14)
- # nbb (4)
- # off-topic (11)
- # other-languages (10)
- # polylith (4)
- # re-frame (2)
- # sci (3)
- # shadow-cljs (20)
- # spacemacs (3)
- # tools-deps (1)
- # vim (4)
Hello All, I need a small help with date time in Java Interop 🙂
I wanted to get the current date time in the format "yyyy-MM-dd HH:mm:ss"
for timezone "Europe/Berlin"
I was using https://github.com/clj-time/clj-time library to achieve it like this,
(require '[clj-time.core :as t]
'[clj-time.format :as f])
(f/unparse
(f/formatter "yyyy-MM-dd HH:mm:ss")
(t/from-time-zone (t/now) (t/time-zone-for-offset -2)))
I would like to know how to do the same with Java Interop ?(.format (DateTimeFormatter/ofPattern "yyyy-MM-dd HH:mm:ss")
(ZonedDateTime/now (ZoneId/of "Europe/Berlin")))
=> "2022-06-18 09:40:31"
My cider-jack-in
command has a 'duplicate key error' I can resolve this error with C-u M-x cider-jack-in
and changing the command. But how can I make this change permanently?
A .dir-locals.el
file in the root of the project can be used to affect the cider-jack-in command by setting variables
https://practical.li/spacemacs/clojure-projects/project-configuration.html
A duplicate key error shouldnt occur unless one of the aliases being added to the default clojure command has a duplicate error itself. Without details this doesnt seem to be a cider issue, but a deps.edn configuration issue.
[nREPL] Starting server via /usr/bin/clojure -Sdeps '{:deps {refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"} nrepl/nrepl {:mvn/version "0.9.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.5.2"} cider/cider-nrepl {:mvn/version "0.27.4"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Error while parsing option "--config-data {:deps {refactor-nrepl/refactor-nrepl {:mvn/version \"3.5.2\"} nrepl/nrepl {:mvn/version \"0.9.0\"} refactor-nrepl/refactor-nrepl {:mvn/version \"3.5.2\"} cider/cider-nrepl {:mvn/version \"0.27.4\"}} :aliases {:cider/nrepl {:main-opts [\"-m\" \"nrepl.cmdline\" \"--middleware\" \"[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]\"]}}}": java.lang.IllegalArgumentException: Duplicate key: refactor-nrepl/refactor-nrepl
how do I figure out, who is injecting these dependencies?my project deps.edn
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
instaparse/instaparse {:mvn/version "1.4.12"}
org.clojure/data.csv {:mvn/version "1.0.1"}}
:aliases
{:test
{:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
io.github.cognitect-labs/test-runner
{:git/tag "v0.5.1" :git/sha "dfb30dd"}}}
:build {:deps {io.github.seancorfield/build-clj
{:git/tag "v0.8.2" :git/sha "0ffdb4c"}}
:ns-default build}}}
and my ~/.clojure/deps.edn
file is the standard templateHello Clojurians. I'm following the https://figwheel.org/tutorial tutorial on a Debian machine, but cannot find how the install the clj
CLI tool (the tutorial uses homebrew
). Installing 'clojure' worked fine, but the arguments are not the same. Many thanks
Uninstall that clojure executable and then follow the instructions here: https://clojure.org/guides/install_clojure