You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Java 10 Eclipse Maven项目报错:java.lang.module.FindException: Module myproject not found

Troubleshooting "Module myproject not found" Error in Eclipse 4.7.3a Java 10 Maven Project

Hey there, let's walk through the most common reasons you're seeing that Error occurred during initialization of boot layer java.lang.module.FindException: Module myproject not found error, and how to fix them:

  • Check your Eclipse run configuration's module path
    When you set up your run configuration, Eclipse might not have automatically added your project's compiled module to the module path. Head to Run Configurations > Java Application > [Your Run Config] > Arguments tab. Look at the VM arguments—make sure there's a --module-path entry that includes your project's target/classes directory (where the compiled module-info.class lives). If it's missing, add it manually, or ensure the "Use module path" option is enabled if available.

  • Verify module-info.java placement and Maven Java version

    • Your module-info.java must live directly in src/main/java (not inside a subpackage) for the JVM to recognize it as the module descriptor. Double-check its location—if it's nested in a package, move it up to the root of your source directory.
    • Make sure your pom.xml is configured for Java 10, since older compiler versions won't properly handle module syntax. Add or update these properties:
      <properties>
          <maven.compiler.source>10</maven.compiler.source>
          <maven.compiler.target>10</maven.compiler.target>
      </properties>
      
  • Sync Eclipse with Maven and rebuild
    Eclipse and Maven can sometimes get out of sync, leading to stale compiled files. Try these steps:

    1. Right-click your project > Maven > Update Project (check "Force Update of Snapshots/Releases" to refresh dependencies fully).
    2. Go to Project > Clean and select "Clean all projects".
    3. Rebuild with Project > Build All.
  • Confirm module name consistency
    Ensure the module name in module-info.java (myproject) matches what Eclipse recognizes. Right-click your project > Properties > Java Build Path > Module tab—check that the module name listed here is exactly myproject. Mismatched names will prevent the JVM from locating your module.

  • Validate your dependencies are properly resolved
    Even though the error is about your own module, missing or broken dependencies can sometimes throw off module resolution. Check that all the requires modules in your module-info.java are present in Eclipse's Maven Dependencies library. If any are missing, run Maven > Download Sources and Javadoc to pull them into your local repo, then re-sync the project.

内容的提问来源于stack exchange,提问作者Arya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:40:57