Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6807481

JVM fails to find JNI DLL in a folder with Unicode chars

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • 6u7
    • tools
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_07"
      Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
      Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)

      FULL OS VERSION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      The JVM is unable to find a JNI DLL (or class files) when the folder name contains Unicode chars.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Did not try

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Download http://java.sun.com/docs/books/tutorial/getStarted/application/examples/HelloWorldApp.java and place into C:\TEST.

      2) Open a DOS window and CD into C:\TEST and "javac HelloWorldApp"

      3) "java HelloWorldApp" then produces "Hello World!" as expected

      4) exit the DOS window and rename C:\TEST to C:\X, where "X" is Unicode character 37329 (decimal).

      5) Open a DOS window and CD into the Unicode folder and "java HelloWorldApp", and it now FAILS with "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp".

      I can work around this problem (-D java.class.path with 8.3 folder names), but there is a related problem finding JNI DLL's that I can not work around.

      Change "HelloWorldApp.java" to depend upon a JNI DLL, place it in the same folder, and verify that it works and can be found when the folder is c:\test. Then, once again, rename c:\test to a folder name with Unicode chars and the JNI DLL is not found. Using -D with java.library.path and a 8.3 name to the Unicode folder does.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      class HelloWorldApp {
          public static void main(String[] args) {
              System.out.println("Hello World!"); // Display the string.
          }
      }

      ---------- END SOURCE ----------

            ksrini Kumar Srinivasan
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: