Java Netbeans,从res文件夹获取文件属性

Java Netbeans,从res文件夹获取文件属性,java,netbeans,resources,Java,Netbeans,Resources,我试图从res文件夹获取属性文件,但出现以下错误: Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name res/Interfaz, locale es_ES 这是项目树: 这是我的简单代码: public class Main { public static void main(String args[]) { Sys

我试图从res文件夹获取属性文件,但出现以下错误:

Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name res/Interfaz, locale es_ES
这是项目树:

这是我的简单代码:

public class Main {

    public static void main(String args[]) {
    System.out.println("Working Directory = " + System.getProperty("user.dir"));
    ResourceBundle rb = ResourceBundle.getBundle("res/Interfaz", Locale.getDefault());
    //String name = rb.getString("name");
    //System.out.println(name);   // Si el idioma del sistema es español, imprime "Nombre".
    
  
    }

}

我正在使用Netbeans 12,我找到了解决方案。由于我的项目是一个Maven项目,遵循Maven约定,我需要在项目的src/main/目录中创建一个新的resources文件夹。下次我使用Maven构建项目时,这个src/main/resources路径将自动标记为资源目录

从代码中,我可以通过以下方式访问它:

 ResourceBundle.getBundle("Interfaz", Locale.getDefault());