Skip to content

Instantly share code, notes, and snippets.

@codecitizen
Created November 25, 2018 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecitizen/aa0d46bd918ac1a107aecc8eccdac056 to your computer and use it in GitHub Desktop.
Save codecitizen/aa0d46bd918ac1a107aecc8eccdac056 to your computer and use it in GitHub Desktop.
How to list all classes from JAR file in Clojure.
(ns list-classes-from-jar
(:import (java.util.jar JarFile)))
(def jar-file (JarFile. "target/s3-file-upload-sls-1.0.0-SNAPSHOT-standalone.jar"))
(def entries (.entries jar-file))
(while (.hasMoreElements entries)
(let [entry (.nextElement entries)]
(println (.getName entry))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment