java 国际化的问题,很简单,可就是报错,不知道为什么?
public static void main(String args[]){
Locale myLocale = Locale.getDefault();
System.out.println(myLocale);
ResourceBundle rb = ResourceBundle.getBundle("Lidi",myLocale);
System.out.println(rb.getString("exit"));
}
报的错:
Exception in thread "main"
java.util.MissingResourceException: Can't find bundle for base name Lidi, locale zh_CN
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:787)
at com.lidi.test.Test1.main(Test1.java:13)
我建的配置文件是:Lidi_zh_CN.properties
------最佳解决方案--------------------代码没问题,是配置文件路径的问题吧
------其他解决方案--------------------着急用呢,高手帮个忙吧