maven下面编译失败,失败提示信息为:程序包com.sun.image.codec.jpeg不存在
这个类文件的位置在jre/lib/rt.jar
在pom.xml文件中:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<!-- 解决maven编译时用到com.sun.*包下的东西 -->
<!----><compilerArguments>
<verbose />
<bootclasspath>${env.JAVA_HOME}\jre\lib\rt.jar;${env.JAVA_HOME}\jre\lib\jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
本文解决了一个Maven项目中遇到的编译错误问题,错误信息为“程序包com.sun.image.codec.jpeg不存在”。文章详细介绍了如何通过配置pom.xml文件中的maven-compiler-plugin插件来指定正确的bootclasspath路径,以确保编译过程能正确识别所需的类。

被折叠的 条评论
为什么被折叠?



