diff libinterp/octave-value/ov-java.cc @ 23929:20c83f619102

bump Java compatibility level to 1.6, minimum supported by Java 9 (bug #51803) * scripts/java/module.mk (%.class): Compile Java with -source 1.6 -target 1.6. * ov-java.cc (octave::JVMArgs::JVMArgs, initialize_jvm, thread_jni_env): Use JNI_VERSION_1_6 to initialize the JVM. Thanks to Ernst Reissner for the suggestion.
author Mike Miller <mtmiller@octave.org>
date Tue, 22 Aug 2017 23:28:06 -0700
parents 336f89b6208b
children 0b7662d8bd02
line wrap: on
line diff
--- a/libinterp/octave-value/ov-java.cc	Tue Aug 22 23:17:41 2017 -0700
+++ b/libinterp/octave-value/ov-java.cc	Tue Aug 22 23:28:06 2017 -0700
@@ -191,7 +191,7 @@
 
     JVMArgs (void)
     {
-      vm_args.version = JNI_VERSION_1_2;
+      vm_args.version = JNI_VERSION_1_6;
       vm_args.nOptions = 0;
       vm_args.options = nullptr;
       vm_args.ignoreUnrecognized = false;
@@ -591,12 +591,12 @@
       // At least one JVM exists, try to attach to it
 
       switch (jvm->GetEnv (reinterpret_cast<void **> (&current_env),
-                           JNI_VERSION_1_2))
+                           JNI_VERSION_1_6))
         {
         case JNI_EDETACHED:
           // Attach the current thread
           JavaVMAttachArgs vm_args;
-          vm_args.version = JNI_VERSION_1_2;
+          vm_args.version = JNI_VERSION_1_6;
           vm_args.name = const_cast<char *> ("octave");
           vm_args.group = nullptr;
           if (jvm->AttachCurrentThread (reinterpret_cast<void **> (&current_env),
@@ -710,7 +710,7 @@
   JNIEnv *env = nullptr;
 
   if (jvm)
-    jvm->GetEnv (reinterpret_cast<void **> (&env), JNI_VERSION_1_2);
+    jvm->GetEnv (reinterpret_cast<void **> (&env), JNI_VERSION_1_6);
 
   return env;
 }