title: javax.imageio.IIOException: Can't read input file
body: <p>I am building a program that compresses a given image and saves it as a JPEG. This is the error message I get:</p>
  
  <pre><code>Exception in thread "main" javax.imageio.IIOException: Can't read input file!
  at javax.imageio.ImageIO.read(Unknown Source)
  at JPEGCompression.main(JPEGCompression.java:23) 
  </code></pre>
  
  <p>Here is my main:</p>
  
  <pre><code>public class JPEGCompression {
  
  public static void main(String[] args) throws IOException{
  
      String imageFile = "/tmp/garden.png";
      BufferedImage i = ImageIO.read(new File(imageFile)); // this line produces the error
      showImage("Original Image", i);
  
      compressAndShow(i, 0.7f);
  
  
  }
  </code></pre>