Maven web project error "import com.sun.image.codec.jpeg.*"
来源:互联网 发布:淘宝小号查询源码 编辑:程序博客网 时间:2024/05/16 11:18
Maven web project error “import com.sun.image.codec.jpeg.*”
This was my third time to write blog on CSDN.
First of all, you should know which *.jar the class “com.sun.image.codec.jpeg” depended on.
It was “rt.jar” and “jce.jar” included in the local JDK.
If you run as “maven build” local maven(webapp)-tomcat projecet, there was a error about “com.sun.image.codec.jpeg”.
You can “Add Library local JDK” by “project->properties(Alt+Enter)->Java Build Path->Libraries->Add Library->JRE System Library”.If you want to pack as *.war automatically and deploy on Jenkins, there was a way to slove.
Due to that Maven Dependencies did not include local JDK, you should put “rt.jar” and “jce.jar” into POM.XML.
Add plugin, such as:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.7</source> <target>1.7</target> <fork>true</fork> <compilerArguments> <verbose /> <bootclasspath> C:\Program Files (x86)\Java\jdk1.7.0_25\jre\lib\rt.jar; C:\Program Files (x86)\Java\jdk1.7.0_25\jre\lib\jce.jar </bootclasspath> </compilerArguments> <executable> C:\Program Files (x86)\Java\jdk1.7.0_25\bin\javac.exe </executable> </configuration></plugin>
PS 1: In “source” and “target”, the “1.7”was version of the server’s JDK.
PS 2: The “C:\Program Files (x86)\Java\jdk1.7.0_25” was the path of the server’s JDK.
PS 3: If you deployed it on local Jenkins, the server’s JDK just was your own JDK.
Of course, if finding dependencies as those and add into pom.xml, project also can work.
<dependency> <groupId>***</groupId> <artifactId>rt</artifactId> <version>*.*</version></dependency><dependency> <groupId>***</groupId> <artifactId>jce</artifactId> <version>*.*</version></dependency>
But I could not find now.
- Maven web project error "import com.sun.image.codec.jpeg.*"
- import com.sun.image.codec.jpeg.JPEGCodec;
- import com.sun.image.codec.jpeg.JPEGCodec;
- import com.sun.image.codec.jpeg.JPEGCodec;
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- MyEclipse import com.sun.image.codec.jpeg.JPEGCodec;
- import com.sun.image.codec.jpeg.JPEGCodec报错
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- 关于import com.sun.image.codec.jpeg.JPEGCodec时报错
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- 图片处理import com.sun.image.codec.jpeg.* 报错
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- import com.sun.image.codec.jpeg.JPEGCodec 找不到包
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- import com.sun.image.codec.jpeg.JPEGCodec不通过 找不到包
- Tensorflow学习: 保存变量和网络
- IOS数据类型及其所有修饰符的使用规则
- leetcode 42Trapping Rain Water
- 重新开始学习android吧之一些基础(二)
- 图像处理-形态学操作
- Maven web project error "import com.sun.image.codec.jpeg.*"
- 微信运动刷步实践教程
- 将train.prototxt文件转为deploy.prototxt文件
- poj 2777 Count Color(线段树)
- Spark on Yarn遇到的几个问题
- Pandas的基本使用
- QCom MSM MDP显示驱动一些点的简记
- 【Java重构系列】重构31式之封装集合
- MongoDB dropDatabse后,数据能恢复么?