0

I have two projects. First exported module project ("prjuno"), second test ("prjTest") to work in Eclipse (version Version: 2023-03 (4.27.0) Build id: 20230309-1520, JDK 17.0.5). I'm trying to call from (prjtest) a self written module (prjuno)

I created 2 maven eclipse projects where my Prjuno class is:

package sm.clagenna.prjuno;

public class PrimoProg {

  public void doTheJob() {
    System.out.println("PrjUno : PrimoProg.doTheJob()" );
  }
}

prjuno module-info.java is:

module prjuno {
  exports sm.clagenna.prjuno;
}

In my second project prjtest class is:

package sm.clagenna.prtest;
import sm.clagenna.prjuno.PrimoProg;

public class PrjTest {

  public void doTheTest() {
    System.out.println("I am in PrjTest");
    PrimoProg prog = new PrimoProg();
    prog.doTheJob();
  }
  
  public static void main(String[] args) {
    PrjTest app = new PrjTest();
    app.doTheTest();
    System.out.println("End of my PrjTest");
  }
}

My prjTest module-info.java is:

module prjTest {
  requires prjuno;
}

I added in project prjTest build path -> Java Build path -> Projects: modulepath=prjuno

If I launch PrjTest I get the error:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module prjuno not found, required by prjTest

For the ease of test I've made 2 GitHub public projects (prjtest) and (prjuno)

If I install my project "prjuno" on my maven repository and declare a dependency on it, everthing ok. But 2 bare eclipse projects no.

I traveled some aswers (like this one related to JavaFX) but didn't find the solution for a self written module project.

Any solution will be highly appreciated

Claudio
  • 69
  • 5
  • 1
    not sure what is meant by "`modulepath=prjuno`" but in the run configuration of Eclipse, `Dependencies` tab, under `Modulepath Entries` there must be `prjuno` ([screenshot](https://i.stack.imgur.com/fiBK4.png)) - if that entry is missing, I get the same error. || after removing all the resources and test folders from the source path (since not in Github) it seems to work: [console output](https://i.stack.imgur.com/J8VWG.png) – user16320675 May 25 '23 at 18:58
  • Thanks! That done the trick! But it's waste of time to declare depedencies twice:1- java build path project modulePath, 2 - Run - Configurations - Dependencies. Anyway thank again – Claudio May 26 '23 at 06:41

0 Answers0