解决maven打包 错误: 程序包com.sun.istack.internal不存在 - BBSMAX

当使用Maven打包项目时,出现'程序包com.sun.istack.internal不存在'的错误。该错误在编译LoginInterceptor类时发生,因为找不到Nullable类。为了解决这个问题,需要在项目中添加相应的依赖并重新打包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

**

解决maven打包 错误: 程序包com.sun.istack.internal不存在 - BBSMAX

**使用com.sun.istack.internal.Nullable包时能正常引用,但是使用maven项目打包jar时报错。

在这里插入图片描述
在使用maven打包时报错信息如下

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /F:/rbcx/rbjc/src/main/java/cn/edu/zut/pro/rbjc/config/intercepors/LoginInterceptor.java:[5,31] 程序包com.sun.istack.internal不存在
[ERROR] /F:/rbcx/rbjc/src/main/java/cn/edu/zut/pro/rbjc/config/intercepors/LoginInterceptor.java:[53,103] 找不到符号
符号: 类 Nullable
位置: 类 cn.edu.zut.pro.rbjc.config.intercepors.LoginInterceptor
[ERROR] /F:/rbcx/rbjc/src/main/java/cn/edu/zut/pro/rbjc/config/intercepors/LoginInterceptor.java:[56,108] 找不到符号
符号: 类 Nullable
位置: 类 cn.edu.zut.pro.rbjc.config.intercepors.LoginInterceptor
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.263 s
[INFO] Finished at: 2019-05-16T15:07:59+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project rbjc: Compilation failure: Compilation failure:
[ERROR] /F:/rbcx/rbjc/src/main/java/cn/edu/zut/pro/rbjc/config/intercepors/LoginInterceptor.java:[5,31] 程序包com.sun.istack.internal不存在
[ERROR] /F:/rbcx/rbjc/src/main/java/cn/edu/zut/pro/rbjc/config/intercepors/LoginInterceptor.java:[53,103] 找不到符号
[ERROR] 符号: 类 Nullable
[ERROR] 位置: 类 cn.edu.zut.pro.rbjc.config.intercepors.LoginInterceptor
[ERROR] /F:/rbcx/rbjc/src/main/java/cn/edu/zut/pro/rbjc/config/intercepors/LoginInterceptor.java:[56,108] 找不到符号
[ERROR] 符号: 类 Nullable
[ERROR] 位置: 类 cn.edu.zut.pro.rbjc.config.intercepors.LoginInterceptor
[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

添加一下依赖重新打包

		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>2.2.11</version>
		</dependency>
		
		<dependency>
			<groupId>org.jetbrains</groupId>
			<artifactId>annotations</artifactId>
			<version>13.0</version>
		</dependency>
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值