In the code sample below, when I test the code in Eclipse it works just fine. However, when I export the jar file and test it via the command line, it throws an error: IIO
IIO
try this
public void test() { try(InputStream is = getClass().getResourceAsStream("Images/questionMark.png")) { ImageIO.read(is); } catch (IOException e) { e.printStackTrace(); } }