因为我要测试java的图片压缩,需要用这三个类,默认这三个类在eclipse是导不进来,直接报错的。

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageEncoder;

解决办法:
Eclipse默认把这些受访问限制的API设成了ERROR。只要把Windows-Preferences-Java-Complicer-Errors/Warnings里面的Deprecated and restricted API中的Forbidden references(access rules)选为Warning就可以编译通过。

相关文章:

  • 2021-09-11
  • 2021-11-04
  • 2021-07-24
  • 2021-06-01
  • 2021-12-15
  • 2022-12-23
  • 2021-07-30
  • 2021-11-29
猜你喜欢
  • 2021-06-10
  • 2021-08-25
  • 2021-07-19
  • 2022-12-23
  • 2021-06-10
  • 2021-12-13
  • 2022-02-24
相关资源
相似解决方案