macos 致命错误: 在类路径或引导类路径中找不到程序包 java.lang
本文环境:MacOS
程序运行没有问题,但在 maven 打包时,报了如下错误:
致命错误: 在类路径或引导类路径中找不到程序包 java.lang[INFO] -------------------------------------------------------------[ERROR] COMPILATION ERROR : [INFO] -------------------------------------------------------------[ERROR] An unknown compilation problem occurred
难道 maven-compiler-plugin 插件配置错了?如下是我的配置信息
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> <compilerArguments> <verbose/> <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath> </compilerArguments> </configuration> </plugin> </plugins></build>
搜索后,发现 Linux/Macos 环境下配置中的分隔符是不一样的:
Windows用 ; 做分隔符
<bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
Mac/Linux用 : 做分隔符
<bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
相关推荐
heheeheh 2020-10-19
zllbirdonland 2020-06-16
gloria0 2020-06-09
tosim 2020-06-03
Jieen 2020-05-30
lfjjia 2020-05-19
oraclemch 2020-05-09
MFCJCK 2020-05-05
Dannyvon 2020-04-27
jackadmi 2020-04-19
无情的你无情的雨 2020-04-07
citic 2020-03-27
tflasd 2020-03-16
wintelx 2020-03-03
tlsmile 2020-02-18
dongfangxiaozi 2020-02-12