I am an idiot. Why can't I read any files?
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class mainClass {
public static void main(String[] args) {
try {
Image picture = ImageIO.read(new File("picture.png"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
And the file is in the src folder for sure.
But it throws the exception everytime even though the file is there, no misspellings.
edit: The first sentence was true, I didn't put the image in the root.