src/share/native/java/io/io_util.c

Print this page

        

@@ -209,11 +209,15 @@
     jobject x;
     jstring why = NULL;
 
     n = getLastErrorString(buf, sizeof(buf));
     if (n > 0) {
+#ifdef WIN32 
+        why = (*env)->NewStringUTF(env, buf);
+#else
         why = JNU_NewStringPlatform(env, buf);
+#endif
     }
     x = JNU_NewObjectByName(env,
                             "java/io/FileNotFoundException",
                             "(Ljava/lang/String;Ljava/lang/String;)V",
                             path, why);