Skip to content

Commit

Permalink
apacheGH-43425: [Java] Upgrade JNI to version 10 (apache#43424)
Browse files Browse the repository at this point in the history
### Rationale for this change

Java 11 is the supported min version, which means we can use JNI version 10. See Version info here: https://docs.oracle.com/en/java/javase/21/docs/specs/jni/functions.html#version-information

### What changes are included in this PR?

* JNI Version upgraded to 10 from 1.6 and 1.8 

### Are these changes tested?

CI/CD

### Are there any user-facing changes?

No
* GitHub Issue: apache#43425

Authored-by: Dane Pitkin <dpitkin@apache.org>
Signed-off-by: David Li <li.davidm96@gmail.com>
  • Loading branch information
danepitkin authored Jul 29, 2024
1 parent c980ebf commit 7acb043
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/source/java/cdata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ This application uses JNI to call Java code, but transfers data (zero-copy) via
JavaVMOption options[2];
options[0].optionString = "-Djava.class.path=cpptojava.jar";
options[1].optionString = "-DXcheck:jni:pedantic";
vm_args.version = JNI_VERSION_1_8;
vm_args.version = JNI_VERSION_10;
vm_args.nOptions = 2;
vm_args.options = options;
int status = JNI_CreateJavaVM(jvm, (void **) &env, &vm_args);
Expand Down
2 changes: 1 addition & 1 deletion java/adapter/orc/src/main/cpp/jni_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static jmethodID orc_memory_constructor;
static jclass record_batch_class;
static jmethodID record_batch_constructor;

static jint JNI_VERSION = JNI_VERSION_1_6;
static jint JNI_VERSION = JNI_VERSION_10;

using arrow::internal::checked_cast;
using arrow::jni::ConcurrentMap;
Expand Down
2 changes: 1 addition & 1 deletion java/c/src/main/cpp/jni_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jmethodID kPrivateDataGetNextMethod;
jmethodID kPrivateDataGetSchemaMethod;
jmethodID kCDataExceptionConstructor;

jint JNI_VERSION = JNI_VERSION_1_6;
jint JNI_VERSION = JNI_VERSION_10;

class JniPendingException : public std::runtime_error {
public:
Expand Down
2 changes: 1 addition & 1 deletion java/dataset/src/main/cpp/jni_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace arrow {
namespace dataset {
namespace jni {

jint JNI_VERSION = JNI_VERSION_1_6;
jint JNI_VERSION = JNI_VERSION_10;

class ReservationListenableMemoryPool::Impl {
public:
Expand Down
2 changes: 1 addition & 1 deletion java/dataset/src/main/cpp/jni_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jmethodID unreserve_memory_method;

jlong default_memory_pool_id = -1L;

jint JNI_VERSION = JNI_VERSION_1_6;
jint JNI_VERSION = JNI_VERSION_10;

class JniPendingException : public std::runtime_error {
public:
Expand Down
2 changes: 1 addition & 1 deletion java/gandiva/src/main/cpp/jni_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ using gandiva::ProjectorHolder;
// forward declarations
NodePtr ProtoTypeToNode(const gandiva::types::TreeNode& node);

static jint JNI_VERSION = JNI_VERSION_1_6;
static jint JNI_VERSION = JNI_VERSION_10;

// extern refs - initialized for other modules.
jclass configuration_builder_class_;
Expand Down

0 comments on commit 7acb043

Please sign in to comment.