7

I'm trying to use the Base 64 functions present in the Apache Commons Codec package. I'm using Leiningen, and have this in my project.clj:

:dependencies [[org.clojure/clojure "1.2.0"]
               [commons-codec/commons-codec "1.4"]]

Leiningen successfully finds the appropriate .jar. I can't for the life of me figure out which class I actually need to import, though. I have tried all variations of

(ns my-project.core
  (:import (org.apache.commons.codec.binary Base64)))

but nothing seems to work. What class name should I be using for this?

2
  • Your code works for me. Are you including the downloaded .jar on your CLASSPATH? Commented Jan 27, 2011 at 0:58
  • Same as brian, creating a clean leiningen project with your settings works. Commented Jan 27, 2011 at 5:01

2 Answers 2

1

I would recommend cutting to the chase and checking where the rubber hits the road. Make sure Leiningen did in fact place the correct jar in the lib directory of your project. Open the jar and look inside and see of the class you are looking for is there. If the path to that class in the jar should match the path of your import statement.

Sign up to request clarification or add additional context in comments.

Comments

1

Whoops. It looks like I was just calling the class itself incorrectly. The following worked fine after the :import line above: (.decode (Base64.) s). Thanks for the responses, everyone.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.