title: Java FileWriter class - java.io.FileNotFoundException: * no such file or directory -Ubuntu
body: <p>I am using this method to generate some turtle files <code>.ttl</code> in a sub-directory of my project:</p>
  
  <pre><code>public static void write(int id, int depth){
          try {
  
              FileWriter fw = null;
              switch (getName()){
              case ("KG1"):
                  fw = new FileWriter("WWW/KG1/" + depth + "/" + id + ".ttl");
              break;
  
              case ("KG2"):
                  fw = new FileWriter("WWW/KG2/" + depth + "/" + id + ".ttl");
              }
  
          // Write something
  
          fw.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  </code></pre>
  
  <p>But I am having this exception when I have put my project in Ubuntu (it is still working fine in Windows) in the java class <code>FileWriter</code>:</p>
  
  <p><code>java.io.FileNotFoundException: /WWW/KG1/2/0.ttl (No such file or directory)</code></p>
  
  <p>I am using Eclipse Neon for both OSs, but it seems that Ubuntu is not happy about it.</p>
  
  <p>Here is what I have tried so far:</p>
  
  <ol>
  <li><p>Adding write permissons to ALL files and directories under the main project directory</p></li>
  <li><p>Using absolute path instead of relative path, by using <code>System.getProperty("usr.dir")</code>, and plotting all the path string I am giving to <code>FileWriter</code>, but it does not work.</p></li>
  </ol>
  
  <p>Any advice?</p>
  
  <p>Thanks!</p>