title: JavaFX locale bundle: Can't find bundle for base name
body: <p>I have JavaFX application with localization. However, I can't make it work as FXML Loader is unable to find localization bundle</p>
  
  <pre><code>Caused by: java.util.MissingResourceException: Can't find bundle for base name bundles.lcars, locale en_US
      at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
      at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
      at java.util.ResourceBundle.getBundle(ResourceBundle.java:845)
      at cz.muni.fi.pv168.view.GUI.start(GUI.java:24)
  </code></pre>
  
  <p><strong>Structure</strong>:</p>
  
  <p><a href="https://i.stack.imgur.com/cZqTk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cZqTk.png" alt="Project structure"></a>    </p>
  
  <p><strong>Main GUI class:</strong></p>
  
  <pre><code>public void start(Stage primaryStage) throws Exception {
      Locale locale = Locale.getDefault();
      FXMLLoader fxmlLoader = new FXMLLoader();
      fxmlLoader.setResources(ResourceBundle.getBundle("bundles.lcars", locale));
      Parent root = FXMLLoader.load(getClass().getResource("lcars.fxml"),ResourceBundle.getBundle("bundles" +
              ".lcars", locale));
      Scene scene = new Scene(root, 1920 , 1080);   // 19:10
      // set scene to stage and other irrelevant stuff
  
  }
  </code></pre>
  
  <p>I also tried to move bundles folder to root package, without success. Also, I tried every already answered question to query "can't find bundle for base name".</p>
  
  <p><strong>EDIT for @Slaw</strong>
  I changed code to this, still no success</p>
  
  <pre><code>FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("lcars.fxml"));
  fxmlLoader.setResources(ResourceBundle.getBundle("bundles.lcars", locale));
  Parent root = fxmlLoader.load();
  </code></pre>
  
  <p>Thank you for help.</p>