This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-30
Channels
- # adventofcode (27)
- # ai (1)
- # announcements (2)
- # aws (66)
- # babashka (2)
- # beginners (34)
- # calva (28)
- # cider (5)
- # clj-kondo (18)
- # clojure (16)
- # clojure-europe (4)
- # clojure-norway (2)
- # clojure-uk (3)
- # clojurescript (11)
- # code-reviews (23)
- # conjure (23)
- # core-logic (1)
- # cursive (12)
- # datalevin (1)
- # datomic (9)
- # introduce-yourself (3)
- # kaocha (3)
- # klipse (4)
- # malli (42)
- # midje (1)
- # minecraft (1)
- # missionary (4)
- # music (1)
- # nextjournal (10)
- # polylith (5)
- # re-frame (2)
- # reitit (1)
- # releases (1)
- # sci (126)
- # shadow-cljs (4)
- # sql (2)
- # tools-deps (11)
I'm running Intellij Idea #IC-213.5744.223 on Apple M1 Silicon. Everything seems to run in Arm64 mode, except for when I'm inside an Intellij terminal. If I run something like lein repl or test-refresh from within that terminal it starts as a rather slow x86 process instead of Arm64. Any idea what might be causing this? Running the exact same command on the same project in a regular iterm2 window starts as arm64.
Long time ago since I did any Java… It impairs my Java interop skills as well. 😃 I have this
package pez;
public class HelloWorld {
public HelloWorld() {
}
public static void main(String[] args) {
System.out.println("Hello, World!");
}
public static String foo() {
return "foo";
}
public String bar() {
return "bar";
}
}
I can import it in a Clojure file but can’t figure out how to use it:
(HelloWorld.) => Syntax error (IllegalArgumentException) compiling new at (src/pez/java_test/java_hello.clj:5:9). No matching ctor found for class pez.HelloWorld
(HelloWorld/foo) => Syntax error (NoSuchFieldException) compiling . at (src/pez/java_test/java_hello.clj:6:3). foo
What am I not getting?A static method should be called with the class (not an instance of the class). (pez.HelloWorld/foo) should return "foo"
the instance method bar should work with (.bar (pez.HelloWorld.)) => "bar"
also, the HelloWorld.class file can be of an old version in the /target if you have made changes to it.
I am calling foo statically there, ain’t I? I am importing this using (:import [pez HelloWorld])
seems right. is the class-file freshly and correctly compiled?
and does the (.bar ...) thing work?
It compiles without complaints. Don’t see any target directory, though. Nor any .cpcache...
I think Java is not able to reload classes once they are loaded. It could be possible to create a new class-loader (clojure does a lot of class-loader related things under the hood).