IllegalArgumentException Input == null
问题 I am trying to read an Image as an InputStream . But for some reason I always get an IllegalArugmentException . Here is my code: BufferedImage i = null; i = ImageIO.read(getClass().getResourceAsStream("/res/graphics" + path)); 回答1: Reason: Your resource evaluates to null and that is why the exception API doc Throws: IllegalArgumentException - if input is null . Solution: If res/graphics/whatever is in classpath at root then it will return not null 回答2: Basically, the resource with the name