maven 在类路径或引导类路径中找不到程序包 java.lang

时间:2021-10-08 09:31:21

报错信息:

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 470 source files to /Users/baozhichao/workspace/meforlite/target/classes
致命错误: 在类路径或引导类路径中找不到程序包 java.lang
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] An unknown compilation problem occurred
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.019 s
[INFO] Finished at: 2017-12-21T16:03:44+08:00
[INFO] Final Memory: 29M/270M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project meforlite: Compilation failure
[ERROR] An unknown compilation problem occurred
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

最近新换到mac电脑,maven打包时报如上的错误,搜索后发现是pom.xml分隔符的问题,注意第603行,在windows下使用maven 应该使用分号(;)分隔,linux/mac 下使用(:)分隔
maven 在类路径或引导类路径中找不到程序包 java.lang