Can't call public method of non-public class: public (Google gcloud library)

前端 未结 4 932
没有蜡笔的小新
没有蜡笔的小新 2021-01-06 13:46

I am attempting to use the gcloud library.

(ns firengine.state
  (:import
   [com.google.cloud AuthCredentials]
   [com.google.cloud.datastore DatastoreOpti         


        
4条回答
  •  耶瑟儿~
    2021-01-06 14:38

    Yeah.... that problem. You wouldnt believe it, but its actually an open bug in the jdk from ... wait for it ... 1999!

    You can read about it more in clojure jira and on google groups.

    You might have to make your own java wrapper to avoid this, or ask the library author to take this old known java bug into consideration.

    If you dont want to write your own java wrapper, and the author insists that "this is the best design, like, ever!", then you could always force it by setting the method accessibility with (.setAccessible method true) and some more custom reflection code..

    Good luck!

提交回复
热议问题