---
title: "上传压缩图片  Found class com.sun.image.codec.jpeg.JPEGImageEncoder, but interface was"
author: "smart_com"
date: "2015-01-08T13:55:49Z"
tags: []
categories: ["Web前端"]
slug: "found-class-com-sun-image-codec-jpeg-jpegimageencoder-but-interface-was"
draft: false
lastmod: "2015-01-08T13:55:49Z"
id: 2173924
url: "https://smart-com.iteye.com/blog/2173924"
---

[Found class com.sun.image.codec.jpeg.JPEGImageEncoder, but interface was expected](http://www.blogjava.net/zoninge/archive/2010/06/11/323352.html)

换了服务器之后,图片处理程序报错:java.lang.IncompatibleClassChangeError: Found class com.sun.image.codec.jpeg.JPEGImageEncoder, but interface was expected  
发现新服务器的JRE是用的openjdk,将openjdk换成SUN的标准JDK,不再报错!