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 6589329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:09:36+00:00 2026-05-25T17:09:36+00:00

I have a java file with a single class and I want to include

  • 0

I have a java file with a single class and I want to include it in my lein project. Where do I put it and how do I import it? (I tried putting it in the src directory under the package path but it tells me ClassNotFound)

So the java file has this package declaration:

package com.thebuzzmedia.imgscalr;

and has this class:

public class Scalr {

I put it in ~/src/com/thebuzzmedia/imgscalr/Scalr.java
and tried to import it from the repl thusly:

(import '(com.thebuzzmedia.imgscalr Scalr))

And I get this:

com.thebuzzmedia.imgscalr.Scalr
[Thrown class java.lang.ClassNotFoundException]

What am I missing?

  • 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-05-25T17:09:36+00:00Added an answer on May 25, 2026 at 5:09 pm

    Where to place Java sources really depends on which build system you’re using. If you’re using Leiningen, you have to configure the source paths:

    (defproject my-project "0.0.1-SNAPSHOT"
      [...]
      :java-source-paths ["src/java" "test/java"])
    

    Then you can import Java classes at those source locations in your code or at the REPL like you were already trying to do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a running java GUI application right now in a single class file,
I have a Java file TestThis.java like the following: class A { public void
I have two Java.io.File objects file1 and file2. I want to copy the contents
If I have a Java source file (*.java) or a class file (*.class), how
I have the following in a java file (MyRtmpClient.java): import org.apache.mina.common.ByteBuffer; and ByteBuffer is
I have a Java program that opens a file using the RandomAccessFile class. I'd
i have a java ee project which has a text file that uses a
I have a single .java (driver.java) file I'm trying to compile and run from
I have a Java project which will include a number of large SQL statements
I am fairly new to Java. I have constructed a single JUnit test class

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.