# HG changeset patch # User aivanov # Date 1571690186 -3600 # Node ID 6d5c7f91e0b590e61957d63316f58c9f34d40055 # Parent fa1f838b54865008e2046b1d93ea9f123882aa57 8232624: Java cannot start: NewStringPlatform missing Reviewed-by: dholmes, alanb, redestad diff -r fa1f838b5486 -r 6d5c7f91e0b5 src/hotspot/share/classfile/javaClasses.cpp --- a/src/hotspot/share/classfile/javaClasses.cpp Mon Oct 21 13:25:36 2019 -0700 +++ b/src/hotspot/share/classfile/javaClasses.cpp Mon Oct 21 21:36:26 2019 +0100 @@ -377,7 +377,7 @@ if (_to_java_string_fn == NULL) { void *lib_handle = os::native_java_library(); - _to_java_string_fn = CAST_TO_FN_PTR(to_java_string_fn_t, os::dll_lookup(lib_handle, "JNU_NewStringPlatform")); + _to_java_string_fn = CAST_TO_FN_PTR(to_java_string_fn_t, os::dll_lookup(lib_handle, "NewStringPlatform")); if (_to_java_string_fn == NULL) { fatal("NewStringPlatform missing"); } diff -r fa1f838b5486 -r 6d5c7f91e0b5 src/java.base/share/native/libjava/jni_util.c --- a/src/java.base/share/native/libjava/jni_util.c Mon Oct 21 13:25:36 2019 -0700 +++ b/src/java.base/share/native/libjava/jni_util.c Mon Oct 21 21:36:26 2019 +0100 @@ -791,6 +791,13 @@ CHECK_NULL(String_value_ID); } +// This alias is used for compatibility with 32 bit Windows +JNIEXPORT jstring +NewStringPlatform(JNIEnv *env, const char *str) +{ + return JNU_NewStringPlatform(env, str); +} + JNIEXPORT jstring JNICALL JNU_NewStringPlatform(JNIEnv *env, const char *str) { diff -r fa1f838b5486 -r 6d5c7f91e0b5 src/java.base/share/native/libjava/jni_util.h --- a/src/java.base/share/native/libjava/jni_util.h Mon Oct 21 13:25:36 2019 -0700 +++ b/src/java.base/share/native/libjava/jni_util.h Mon Oct 21 21:36:26 2019 +0100 @@ -93,6 +93,9 @@ JNU_ThrowIOExceptionWithLastError(JNIEnv *env, const char *defaultDetail); /* Convert between Java strings and i18n C strings */ +JNIEXPORT jstring +NewStringPlatform(JNIEnv *env, const char *str); + JNIEXPORT const char * GetStringPlatformChars(JNIEnv *env, jstring jstr, jboolean *isCopy);