com.google.api-client/google-api-client to my project.clj according to the groupId, artifactId and version.lein deps returns no output - seems like it setups all the dependencies successfully.(System/getProperty "java.class.path").
user=>(require 'com.google.api-client/google-api-client) returns FileNotFoundException Could not locate google_api_client__init.class or google_api_client.clj on classpath: clojure.lang.RT.load (RT.java:443)Here is my project.clj:
(defproject textsync "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[com.google.api-client/google-api-client "1.18.0-rc"]
What am I doing wrong?
You have to import a java class into the clojure namespace like,
(import 'org.apache.commons.lang.StringUtils) ;replace the java file with what you want
require is only for importing other clojure name spaces. You have to use import when you are importing java classes into clojure name spaces.
You most probably simply need to import the classes you want. For instance, you may want to try :
(import '[com.google.api.client.googleapis GoogleUtils]
'[com.google.api.client.googleapis.services AbstractGoogleClient
AbstractGoogleClient$Builder])
Note that :
the class is spelled com.google.api.client.googleapis.GoogleUtils (with no dash)
the Clojure syntax for Java nested classes uses $.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With