Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9236777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:22:45+00:00 2026-06-18T07:22:45+00:00

I am testing out Clojure/Java interop. I created a new Leiningen project and created

  • 0

I am testing out Clojure/Java interop. I created a new Leiningen project and created this project.clj file with a few dependencies I’ll be using:

    (defproject kente "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.4.0"]
                     [ring/ring-jetty-adapter "1.0.0-RC1"]
                     [compojure "0.6.5"]
                     [hiccup "0.3.7"]
                     [cheshire "5.0.1"]]
      :java-source-paths ["src/java"]
      :plugins [[lein-ring "0.8.2"]]
      :ring {:handler kente.core/application}
      :main kente.core)

I also included the “java-source-paths” list and put a hello.java file into the src/java directory that looks like this:

public class hello {

    private String msg = "Hello World";

    public String sayHello() {
        return this.msg;
    }

}

and then I created this core.clj file from the template:

    (ns kente.core
      (:require [java/hello]))

    (defn application
      "I don't do a whole lot."
      [x]
      (println x "Hello, World!"))

    (defn -main [] (application "Say: "))

As you can see, I’m not even using the hello java class in the application function, I’m just requiring it, but I get this stack trace when I run “lein jar” in the terminal:

    $ lein jar
    Compiling kente.core
    Exception in thread "main" java.io.FileNotFoundException: Could not locate hello__init.class or hello.clj on classpath: , compiling:(core.clj:1)
            at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3387)
            at clojure.lang.Compiler.compile1(Compiler.java:7035)
            at clojure.lang.Compiler.compile1(Compiler.java:7025)
            at clojure.lang.Compiler.compile(Compiler.java:7097)
            at clojure.lang.RT.compile(RT.java:387)
            at clojure.lang.RT.load(RT.java:427)
            at clojure.lang.RT.load(RT.java:400)
            at clojure.core$load$fn__4890.invoke(core.clj:5415)
            at clojure.core$load.doInvoke(core.clj:5414)
            at clojure.lang.RestFn.invoke(RestFn.java:408)
            at clojure.core$load_one.invoke(core.clj:5227)
            at clojure.core$compile$fn__4895.invoke(core.clj:5426)
            at clojure.core$compile.invoke(core.clj:5425)
            at user$eval7.invoke(NO_SOURCE_FILE:1)
            at clojure.lang.Compiler.eval(Compiler.java:6511)
            at clojure.lang.Compiler.eval(Compiler.java:6501)
            at clojure.lang.Compiler.eval(Compiler.java:6477)
            at clojure.core$eval.invoke(core.clj:2797)
            at clojure.main$eval_opt.invoke(main.clj:297)
            at clojure.main$initialize.invoke(main.clj:316)
            at clojure.main$null_opt.invoke(main.clj:349)
            at clojure.main$main.doInvoke(main.clj:427)
            at clojure.lang.RestFn.invoke(RestFn.java:421)
            at clojure.lang.Var.invoke(Var.java:419)
            at clojure.lang.AFn.applyToHelper(AFn.java:163)
            at clojure.lang.Var.applyTo(Var.java:532)
            at clojure.main.main(main.java:37)
    Caused by: java.io.FileNotFoundException: Could not locate hello__init.class or hello.clj on classpath:
            at clojure.lang.RT.load(RT.java:432)
            at clojure.lang.RT.load(RT.java:400)
            at clojure.core$load$fn__4890.invoke(core.clj:5415)
            at clojure.core$load.doInvoke(core.clj:5414)
            at clojure.lang.RestFn.invoke(RestFn.java:408)
            at clojure.core$load_one.invoke(core.clj:5227)
            at clojure.core$load_lib.doInvoke(core.clj:5264)
            at clojure.lang.RestFn.applyTo(RestFn.java:142)
            at clojure.core$apply.invoke(core.clj:603)
            at clojure.core$load_libs.doInvoke(core.clj:5298)
            at clojure.lang.RestFn.applyTo(RestFn.java:137)
            at clojure.core$apply.invoke(core.clj:603)
            at clojure.core$require.doInvoke(core.clj:5381)
            at clojure.lang.RestFn.invoke(RestFn.java:408)
            at kente.core$loading__4784__auto__.invoke(core.clj:1)
            at clojure.lang.AFn.applyToHelper(AFn.java:159)
            at clojure.lang.AFn.applyTo(AFn.java:151)
            at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3382)
            ... 26 more

What should I be doing differently?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:22:46+00:00Added an answer on June 18, 2026 at 7:22 am

    Check out my answer here, it’s pretty much what you want I think: https://stackoverflow.com/a/14014153/6264

    Hints:

    • don’t use a naked package structure – maybe you can, but it generally leads to unwanted problems
    • Java classes get imported, not required. Importing is only needed when you don’t want to type the package prefix.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently testing out using OSGi. I am running this through Eclipse. I
Testing out Web API for file uploading, have a simple view model like this:
I'm testing out a package (git clone git://guacamole.git.sourceforge.net/gitroot/guacamole/guacamole) This project has two branches: 'master'
Testing out someone elses code, I noticed a few JSP pages printing funky non-ASCII
Im testing out some database compact code using a simple form to add data
I've been testing out some of the new stuff in VS 2010 and C#
I have been testing out a few different xml editor/viewers and I can't seem
I'm testing out the PostgreSQL Text-Search features, using the September data dump from StackOverflow
I have been testing out using delegates instead of reflection for some object sorting
I am testing out the accelerometer and I tried using the default AIR for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.