From 7c90a9b2a1e075515b297ac56623f46e99cf4556 Mon Sep 17 00:00:00 2001 From: Jian Chen Date: Sat, 18 Jan 2025 11:51:06 -0500 Subject: [PATCH] Upgrade Java version from react-native/android to Java 17 (#23066) ### Description Upgrade Java version from react-native/android to Java 17. This PR does not update the e2e Java 17 version --- js/react_native/android/build.gradle | 4 ++-- js/react_native/android/gradle.properties | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/react_native/android/build.gradle b/js/react_native/android/build.gradle index 521866ff0f3e2..df5792d274592 100644 --- a/js/react_native/android/build.gradle +++ b/js/react_native/android/build.gradle @@ -127,8 +127,8 @@ android { disable 'GradleCompatible' } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } sourceSets { diff --git a/js/react_native/android/gradle.properties b/js/react_native/android/gradle.properties index 21fbbef09fc05..5f8bcd99315a8 100644 --- a/js/react_native/android/gradle.properties +++ b/js/react_native/android/gradle.properties @@ -4,7 +4,7 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx1024m -XX:MaxPermSize=256m -org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Djavax.xml.accessExternalSchema=all -Djavax.xml.accessExternalDTD=all # # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit @@ -17,3 +17,7 @@ OnnxruntimeModule_buildToolsVersion=29.0.2 OnnxruntimeModule_compileSdkVersion=34 OnnxruntimeModule_minSdkVersion=24 OnnxruntimeModule_targetSdkVersion=34 + +systemProp.javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl +systemProp.javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl +systemProp.javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl