title: URI path not absolute exception java(not android)
body: <p>I have the following piece of source code</p>
  
  <pre><code>import java.net.URI;
  import java.net.URISyntaxException;
  
      File file = new File("pic.png");
      BufferedImage image = ImageIO.read(file);
      String string = "pic.png";
   //the code works fine until here
      URI path = new URI(string);
      File f = new File(path);
      ColorProcessor image = new ColorProcessor(ImageIO.read(f));
  </code></pre>
  
  <p>So the path that the File gets is correct. Image is buffered correctly also.
  Now my problem is that i'm getting the following exception</p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: URI is not absolute
      at java.io.File.&lt;init&gt;(Unknown Source)
  </code></pre>
  
  <p>Why is my path not absolute?And how do i do it right?</p>
  
  <p>If i change the path like this:</p>
  
  <pre><code>String string = "C:'\'Users'\'Jurgen'\'newFile'\'myProject'\'pic.png";
  </code></pre>
  
  <p>Also tried like this</p>
  
  <pre><code>String string = "C:/Users/Jurgen/newFile/myProject/pic.png";
  </code></pre>
  
  <p>Then i get a new exception </p>
  
  <pre><code>Exception in thread "main" java.lang.IllegalArgumentException: URI is not hierarchical
      at java.io.File.&lt;init&gt;(Unknown Source)
  </code></pre>
  
  <p>P.S. not working with android packages for uri</p>
  
  <p>Thanks in advance=)</p>