what library I need so I can access this com.sun.image.codec.jpeg in Java?

前端 未结 4 2124
忘掉有多难
忘掉有多难 2021-02-07 21:29

I\'m creating an image watermarking program in java and I imported the followings:

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPE         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-07 21:38

    Take a look here Link

    1. Open project properties.
    2. Select Java Build Path node.
    3. Select Libraries tab.
    4. Remove JRE System Library.
    5. Add Library JRE System Library.
    

    As Milad suggested

    Even though this WILL work, this goes against all recommended Java Runtime policies. The best practice is to avoid using rt.jar (or any other Sun supplied runtime library for that matter, like tools.jar)

提交回复
热议问题