I tried to open a png file using ImageIO.read(). but i got the following Error:
java.lang.NoClassDefFoundError: Could not initialize class javax.imageio.ImageIO.
The version of JDK is 1.7
who can help me to solve this problem?
Post the entire error message, including stacktrace. Like this there is little to say about it other than "something is wrong".
Also just to be 100% sure: how are you running this Java program? From an IDE, on the command line? If on the command line, using what exact command?
And to be 200% sure: what does java -version print?