标签:
jenkins bulid时报错,是因为com.sun.image.codec.jpeg是sun公司私有包,oracle在1.7后不再支持
修改下代码即可解决问题
原code:
BufferedImage tag = new BufferedImage((int) newWidth, (int) newHeight, BufferedImage.TYPE_INT_RGB);
FileOutputStream out = new FileOutputStream(dir+filename);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(tag);
现code:
String formatName = filename.substring(filename.lastIndexOf(".") + 1);
ImageIO.write(tag, formatName, new File(dir+ filename));
package com.sun.image.codec.jpeg does not exist
标签:
原文地址:http://my.oschina.net/u/1259194/blog/525477