Quantcast
Channel: OKWAVE 閲覧数の多い質問(Java/253)【本日】
Viewing all articles
Browse latest Browse all 68675

ResourceBundleクラスの使い方

$
0
0
ResourceBundleクラスを使用してプロパティファイルに定義した値を取得しようと したのですがうまくいかなくて困っています。 java.util.MissingResourceException: Can't find bundle for base name resources, locale ja_JP と表示されてしまいます。 どなたか原因はお分かりになりますでしょうか javaファイル、プロパティファイルは以下のようになっています。 クラスパスは以下のように設定しておりプロパティファイルはカレントディレクトリ及びCドライブ 直下に置いています。 CLASSPATH=.;C:\ 【PropertyTest.java】 public class PropertyTest {   public static void main(String[] args) {     ResourceBundle source = ResourceBundle.getBundle("resources");     System.out.println(source.getString("hello.world"));   } } 【resources_ja_JP.properties】 hello.world=Hello, World!

Viewing all articles
Browse latest Browse all 68675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>