luminus-framework / luminus-framework/luminus

java.lang.ClassNotFoundException error when project has java source files

Open
#166 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
626
Forks
122
PR merge metrics
No merged PRs in 30d

Description

I created a basic luminus app using

lein new luminus myapp

and added

:java-source-paths ["src/java"] in project.clj file

and added a simple java file
src/java/com/example/Hello.java

```
package com.example;

public class Hello
{

public static String getFoo()
{
return "foo";
}

}

```

In src/clj/myapp/routes/home.clj, I'm referencing this function getFoo()

When I run
lein javac

It gives me an error

java.lang.ClassNotFoundException: com.example.Hello

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the setup from project.clj using :java-source-paths ["src/java"], src/java/com/example/Hello.java, and the reference from src/clj/myapp/routes/home.clj. Start by running lein javac and inspect how the Java source path and compiled class are handled. Done means the example compiles and com.example.Hello.getFoo() can be resolved without ClassNotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.