java sun.org.mozilla_maven编译找不到符号 sun.org.mozilla.javascript.internal



问题:

[ERROR] 位置: 类 cn.ffcs.dep.rule.script.javascript.JSAdapter 软件包 sun.org.mozilla.javascript.internal 不存在

[ERROR] -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-p

lugin:3.1:compile (default-compile) on project sq-edi-component: Compilation failure

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure

at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:858)

解决:

添加javac编译时的参数bootclasspath,oracle sun不鼓励开发人员直接使用sun.*里面的代码,主要的原因是sun.*里面的代码就是实现jvm的底层代码,是平台相关的,而且相关实现随着版本升级随时可能会被替换,代码的稳定性、一致性等等都存在问题. 参考下http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javac.html javac的相关参数说明

Sometimes, you need to pass other compiler arguments that are not handled by the Compiler Plugin itself but is supported by the compilerId selected. For such arguments, the Compiler Plugin's compilerArguments will be used. The following example passes compiler arguments to the javac compiler:

[...]

[...]

org.apache.maven.plugins

maven-compiler-plugin

2.3.2

-verbose -bootclasspath ${java.home}\lib\rt.jar

[...]

[...]

Or you can also use the Map version:

[...]

[...]

org.apache.maven.plugins

maven-compiler-plugin

2.3.2

${java.home}\lib\rt.jar

[...]

[...]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值