title: Why does the getResource() method return null in JDK 11?
body: <p>Simple Java program:</p>
  
  <pre><code>public static String loadText(String file) {
      StringBuilder finalString = new StringBuilder();
  
      InputStream in = null;
      BufferedReader reader = null;
      InputStreamReader isr = null;
  
      try{
          System.out.println("Text File: " + file);
  
          // Version 1
          //URL url = Thread.currentThread().getClass().getResource(file); 
          //in = url.openStream();
  
          // Version 2
          in = Class.class.getResourceAsStream(file);
  
          isr = new InputStreamReader(in);
          reader = new BufferedReader(isr);
          String line;
          while((line = reader.readLine()) != null) {
              finalString.append(line).append("//\n");
          }
      }
      catch(IOException e) {
          e.printStackTrace();
          System.exit(-1);
      }
      finally {
          try {
              if (isr != null) { isr.close(); }
              if (reader != null) { reader.close(); }
              if (in != null) { in.close(); }
              } catch (IOException e) { e.printStackTrace(); }
          }
      return finalString.toString();
  }
  </code></pre>
  
  <p>The <code>getResource</code> and <code>getResourceAsStream</code> methods works fine in JDK 8 (java-8-openjdk-amd64) but they always return <code>null</code> in JDK 11.</p>
  
  <p>Questions: Why? And how can I fix this?</p>
  
  <ul>
  <li>Operation System: Linux Mint 19 Tara x64</li>
  <li>IDE: Eclipse 2018-12 (4.10.0)</li>
  </ul>