繁体   English   中英

找不到资源包

[英]Can't find resource bundle

我正在尝试加载属性文件,但我不断收到此错误:

线程“main”中的异常java.util.MissingResourceException:无法找到基本名称D的包:\\ bdtej04694 \\ Mis documentos \\ NetBeansProjects \\ SMS_Clientes_Menores \\ dist \\ lib \\ help.properties,java.util.ResourceBundle.throwMissingResourceException中的locale es_VE (ResourceBundle.java:1499)at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)at java.util.ResourceBundle.getBundle(ResourceBundle.java:721)

我正在努力做到这一点

    private static PropertyResourceBundle slInfo = null;
    //and in another method i'm doing this
    String directory = System.getProperty("user.dir");
            slInfo = (PropertyResourceBundle)ResourceBundle.getBundle(directory+"\\dist\\lib\\help.properties"); 
//I put it on a different folder, just in case i want to make changes in the connection strings inside the properties files, without build the project again in netbeans

我在网上搜索(很显然,在此页面中),但找不到适合我的问题的方法

提前致谢

它似乎你的属性文件的路径有问题

D:\bdtej04694\Mis documentos\NetBeansProjects\SMS_Clientes_Menores\dist\lib\help.properties

尽量避免在属性文件的路径中留出空间,你在这里有一个Mis documentos

关于你评论:

改变你的路径如下

String tempPath =  directory+"\\dist\\lib\\help.properties";
String finalPath = tempPath.replace("\\", "/");

并使用此finalPath

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM