import com.sun.image.codec.jpeg.*

后端 未结 6 981
时光取名叫无心
时光取名叫无心 2020-11-27 16:37

I have a Java program when I compile it I get the following error

[javac] ...\\MyClass.java:33: package com.sun.image.codec.jpeg does not exist
[javac] impor         


        
6条回答
  •  -上瘾入骨i
    2020-11-27 17:17

    I had this problem when compiling with JDK 7. Strange enough Eclipse did not show this error, only javac did. The answer can be found in this Stackoverflow answer: javac uses a special symbol table that does not include all Sun-proprietary classes, and suppliying -XDignore.symbol.file makes the problem go away.

    Of course, a much better solution is to rewrite the code without using the proprietary classes, but to support JDK 7 quickly, this option works.

提交回复
热议问题