< prev index next >

src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java

Print this page

        

@@ -250,14 +250,18 @@
                 .toLowerCase(Locale.ROOT);
         USE_OLDMAPPING = (oldmapping.equals("yes") || oldmapping.equals("true"));
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
                 try {
-                    String libDir = System.getProperty("java.home") + File.separator + "lib";
+                    String pathToRules = System.getProperty("jdk.time.tzdbfile");
+                    if (pathToRules == null) {
+                        pathToRules = System.getProperty("java.home") + File.separator +
+                            "lib" +  File.separator + "tzdb.dat";
+            }
                     try (DataInputStream dis = new DataInputStream(
                              new BufferedInputStream(new FileInputStream(
-                                 new File(libDir, "tzdb.dat"))))) {
+                                 new File(pathToRules))))) {
                         load(dis);
                     }
                 } catch (Exception x) {
                     throw new Error(x);
                 }
< prev index next >