I posted this on the #beginners channel, but we weren't able to come up with a solution so I'm x-posting here. am having issues opening a JFrame with cider-middleware running on MacOS. I have the following script:
(ns example.core
(:import
[javax.swing JFrame]))
(doto (JFrame/new)
(.setSize 100 100)
(.setDefaultCloseOperation JFrame/HIDE_ON_CLOSE)
(.setVisible true))
• If I run it as a script clojure -M src/example/core.clj a window opens as expected.
• If I start a nrepl (without cider middleware) and connect to it via cider-connect I can eval the form and a window opens.
• However if I use cider-jack-in and eval the form the window does not open.
• Also if I start an nrepl with cider-middleware and connect to it from cider via cider-connect and eval the form the window does not open.
• When I eval the form with cider-middleware running, I get a result (#object[javax.swing.JFrame...]) as I would expect, just no window.
Is this a known issue on macOS? I have no issues opening from cider on a linux machine, just macOS. For reference, here are the versions of the applicable libraries I'm running:
• CIDER 1.15.1 (Cogne)
• nREPL 1.3.0-beta3
• Clojure 1.12.0
• Java 23.0.1Thanks for the help, however I'm not sure if that is the same issue. I am not running JavaFX, and Swing doesn't seem to have a comparable initializer. As it stands, I can start an nrepl, and connect to it from cider and get the interactive coding experience that I am looking for, but I lose the other great cider features like jump-to-definition and having inline code hints. I'm sure its something in my pipeline because I can't find anyone with a similar issue as I am searching around. I am tempted to take the "nuke the whole environment and start over" approach.
It may be that you need this https://github.com/clojure-emacs/orchard/issues/250#issuecomment-2074925678
(`user.clj` has the special semantic of being loaded before anything else, including cider, which is why it works)