[Freeswitch-svn] [commit] r5759 - freeswitch/trunk/src/mod/languages/mod_java

Freeswitch SVN dacha at freeswitch.org
Wed Sep 26 11:13:48 EDT 2007


Author: dacha
Date: Wed Sep 26 11:13:47 2007
New Revision: 5759

Modified:
   freeswitch/trunk/src/mod/languages/mod_java/Makefile.in
   freeswitch/trunk/src/mod/languages/mod_java/freeswitch_java.cpp
   freeswitch/trunk/src/mod/languages/mod_java/mod_java.c

Log:
Reduced JNI version from 1_6 to 1_4, and used javac and jar in PATH not in JAVA_HOME to build (on MacOS)


Modified: freeswitch/trunk/src/mod/languages/mod_java/Makefile.in
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/Makefile.in	(original)
+++ freeswitch/trunk/src/mod/languages/mod_java/Makefile.in	Wed Sep 26 11:13:47 2007
@@ -4,7 +4,6 @@
 # and define these variables to impact your build
 
 JAVA_FLAGS=@JAVA_FLAGS@
-JAVA_HOME=@JAVA_HOME@
 # Without -fno-strict-aliasing, g++ generates invalid code for Java_org_freeswitch_freeswitchJNI_SWIGJavaSessionUpcast, which segfaults
 LOCAL_CFLAGS=$(JAVA_FLAGS) -fno-strict-aliasing
 LOCAL_OBJS=freeswitch_java.o switch_swig_wrap.o
@@ -19,8 +18,8 @@
 
 local_depend:
 	mkdir -p classes
-	$(JAVA_HOME)/bin/javac -sourcepath src -d classes $(CLASSES)
-	$(JAVA_HOME)/bin/jar cf freeswitch.jar -C classes org
+	javac -sourcepath src -d classes $(CLASSES)
+	jar cf freeswitch.jar -C classes org
 
 reswig:
 	rm -f switch_swig_wrap.cpp

Modified: freeswitch/trunk/src/mod/languages/mod_java/freeswitch_java.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/freeswitch_java.cpp	(original)
+++ freeswitch/trunk/src/mod/languages/mod_java/freeswitch_java.cpp	Wed Sep 26 11:13:47 2007
@@ -17,7 +17,7 @@
     JNIEnv *env;
     jint res;
 
-    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
+    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
     if (res == JNI_OK)
     {
         if (cb_state.function)
@@ -57,7 +57,7 @@
     jobject globalArgs = NULL;
     jint res;
 
-    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
+    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
     if (res != JNI_OK)
     {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error getting JNIEnv!\n");
@@ -104,7 +104,7 @@
     jobject globalHangupHook;
     jint res;
 
-    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
+    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
     if (res != JNI_OK)
     {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error getting JNIEnv!\n");
@@ -143,7 +143,7 @@
         return;
     }
 
-    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
+    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
     if (res == JNI_EDETACHED)
     {
         res = javaVM->AttachCurrentThread((void**)&env, NULL);
@@ -185,7 +185,7 @@
         return SWITCH_STATUS_FALSE;
     }
 
-    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_6);
+    res = javaVM->GetEnv((void**)&env, JNI_VERSION_1_4);
     if (res != JNI_OK)
     {
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "error getting JNIEnv!\n");

Modified: freeswitch/trunk/src/mod/languages/mod_java/mod_java.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/mod_java.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_java/mod_java.c	Wed Sep 26 11:13:47 2007
@@ -229,7 +229,7 @@
         jint res;
 
         memset(&initArgs, 0, sizeof(initArgs));
-        initArgs.version = JNI_VERSION_1_6;
+        initArgs.version = JNI_VERSION_1_4;
         initArgs.nOptions = optionCount;
         initArgs.options = options;
         initArgs.ignoreUnrecognized = JNI_TRUE;



More information about the Freeswitch-svn mailing list