Java Clojure访问静态内部类生成器需要var,但在生成时映射到类错误
在Clojure中,我想互操作以使用:Java Clojure访问静态内部类生成器需要var,但在生成时映射到类错误,java,
elasticsearch,clojure,elasticsearch-jest,Java,
elasticsearch,Clojure,Elasticsearch Jest,在Clojure中,我想互操作以使用: JestClientFactory factory = new JestClientFactory(); factory.setHttpClientConfig(new HttpClientConfig .Builder("http://localhost:9200") .build()); 所以我写了一些这样的代码: (:import (io.searchbox.clie
JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder("http://localhost:9200")
.build());
所以我写了一些这样的代码:
(:import (io.searchbox.client JestClientFactory)
(io.searchbox.client.config HttpClientConfig$Builder))
(let [factory (JestClientFactory.)
http-client-config (-> (HttpClientConfig$Builder "http://localhost:9200")
(.build))])
但是我在构建jar时遇到了以下错误
应为var,但HttpClientConfig$Builder映射到类io.searchbox.client.config.HttpClientConfig$Builder
任何帮助都会很好 在
HttpClientConfig$Builder
后面缺少
。您的代码基本上对类进行静态调用。您需要示例中的新
(>(HttpClientConfig$Builder)。”http://localhost:9200“”;注意``
(.建造)