gpt4 book ai didi

java - 找不到基本名称的 bundle

转载 作者:IT老高 更新时间:2023-10-28 20:22:19 25 4
gpt4 key购买 nike

我正在使用一个依赖于 jfreechart (v 1.0.9) 的库。

当我尝试运行 .jar 时,我得到:

java.util.MissingResourceException: Can't find bundle for base name
org.jfree.chart.LocalizationBundle, locale en_US
at java.util.ResourceBundle.throwMissingResourceException
(ResourceBundle.java:1521)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:962)

我尝试创建一个 LocalizationBundle.properties 文件,但没有成功。我检查了CLASSPATH,还是不行。

有什么想法吗?

最佳答案

java.util.MissingResourceException: Can't find bundle for base name    org.jfree.chart.LocalizationBundle, locale en_US

到了这一点,异常消息详细说明您需要在类路径中有以下文件之一:

/org/jfree/chart/LocalizationBundle.properties

or

/org/jfree/chart/LocalizationBundle_en.properties

or

/org/jfree/chart/LocalizationBundle_en_US.properties

Also see the official Java tutorial about resourcebundles for more information.

But as this is actually a 3rd party managed properties file, you shouldn't create one yourself. It should be already available in the JFreeChart JAR file. So ensure that you have it available in the classpath during runtime. Also ensure that you're using the right version, the location of the propertiesfile inside the package tree might have changed per JFreeChart version.

When executing a JAR file, you can use the -cp argument to specify the classpath. E.g.:

java -jar -cp c:/path/to/jfreechart.jar yourfile.jar

或者,您可以将类路径指定为 JAR list 文件中的 class-path 条目。您可以在其中使用相对于 JAR 文件本身的相对路径。不要使用 %CLASSPATH% 环境变量,它会被 JAR 和其他所有不使用 java.exe 执行的变量忽略 没有 -cp-classpath-jar参数。

关于java - 找不到基本名称的 bundle ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2083159/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com