-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
beta
-
x86
-
windows_nt
Name: skT45625 Date: 08/09/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
Program text:
package com.test;
import java.util.*;
public class BundleTest {
public static void main (String args[]) {
try {
ResourceBundle resource = ResourceBundle.getBundle
( "bundle",Locale.getDefault());
if (resource !=null) {
System.out.println("Bundle found.");
}
} catch (MissingResourceException mre) {
System.err.println("bundle.properties " + " resource not found");
mre.printStackTrace();
}
}
}
1. write program to get ResourceBundle ( I put it in com.test package)
2. compile it
2. put it all in jar (jar cfvm tst.jar manifest.mf com bundle.properties)
*.properties files, manifest.mf with indicating Main-Class
manifest.mf source:
Manifest-Version: 1.0
Main-Class: com.test.BundleTest
3. and run it with java -jar com.test.BundleTest
if jar is in e.g. E:\test bundle found succesfully.
if jar is in e.g E:\!test bundle is not found.
and says that
bundle resource not found
java.util.MissingResourceException: Can't find bundle for base name bundle,
locale us_us
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source
)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at com.test.BundleTest.main(BundleTest.java:7)
(Review ID: 108166)
======================================================================
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
Program text:
package com.test;
import java.util.*;
public class BundleTest {
public static void main (String args[]) {
try {
ResourceBundle resource = ResourceBundle.getBundle
( "bundle",Locale.getDefault());
if (resource !=null) {
System.out.println("Bundle found.");
}
} catch (MissingResourceException mre) {
System.err.println("bundle.properties " + " resource not found");
mre.printStackTrace();
}
}
}
1. write program to get ResourceBundle ( I put it in com.test package)
2. compile it
2. put it all in jar (jar cfvm tst.jar manifest.mf com bundle.properties)
*.properties files, manifest.mf with indicating Main-Class
manifest.mf source:
Manifest-Version: 1.0
Main-Class: com.test.BundleTest
3. and run it with java -jar com.test.BundleTest
if jar is in e.g. E:\test bundle found succesfully.
if jar is in e.g E:\!test bundle is not found.
and says that
bundle resource not found
java.util.MissingResourceException: Can't find bundle for base name bundle,
locale us_us
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source
)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at com.test.BundleTest.main(BundleTest.java:7)
(Review ID: 108166)
======================================================================
- duplicates
-
JDK-4730642 '!' within a directory name is misidentified as the jar separator
- Closed
- relates to
-
JDK-4523159 getResourceAsStream on jars in path with "!"
- Open
-
JDK-8295392 jars in directories which end with '!' fail to load resource bundles
- Open