Questions tagged [jnienv]

The env pointer is a structure that contains the interface to the JVM. It includes all of the functions necessary to interact with the JVM and to work with Java objects.

195 questions
0
votes
1 answer

Android JNI: SIGSEGV on CallObjectMethod

I am trying to call method of custom Java type, but receiving SIGSEGV signal. Here is the Java Code package com.example.JniApi; public class JniApi { public void test() { MyType obj = new MyType(); …
Igor
  • 124
  • 10
0
votes
1 answer

JNI - Send a large byte[] buffer to C++

I'm trying to send a large java buffer byte[] (e.g. 460800) to C++ function using JNI. Below is the sample code: JNIExport void JNICALL XXXXXX_onRecvData(JNIEnv *env, jclass class, jbyteArray data) { jbyte *pData = NULL; pData =…
pree
  • 2,297
  • 6
  • 37
  • 55
0
votes
1 answer

How to transfer my code in C++ interface

jboolean Java_org_opencv_samples_NativeActivity_CvNativeActivity_BrightnessJNI ( JNIEnv* env, jobject thiz, jint height, jint width, jintArray in, jintArray out) { jint* _in = env->GetIntArrayElements(in, 0); jint* _out =…
AHF
  • 1,070
  • 2
  • 15
  • 47
0
votes
1 answer

eclipse/java -- java.lang.UnsatisfiedLinkError: no ndbclient in java.library.path

This seems to be a very simple problem and I'm hoping for a simple answer. I've read many posts on this but haven't found a solution. Here's a simple program: package org.foo.test.LoadLibTest; public class Main { public static void…
paiego
  • 3,619
  • 34
  • 43
0
votes
1 answer

How to implement observer pattern in C++, calling Java method in JNI

I have code that is implementing an observer pattern in C++. I have created Java JNI code that is similar to C++ code to register an observer. When I register an observer in Java, it calls a native method that create a listener in C++. I want the…
Nicholas
  • 7,403
  • 10
  • 48
  • 76
0
votes
1 answer

JNI Headers not found from xcode

After installing Java 7, All of sudden xcode failed to compile my project saying jni.h file not found error. I've tried by removing java 7 manually with 'rm' command. If I provide compiler flags in xcode project build setting with the path :…
dg_no_9
  • 1,005
  • 1
  • 10
  • 25
0
votes
1 answer

JNI call equivalent to MultiByteToWideChar(...)?

I was using WideCharToMultiByte, but I replaced it with env->GetStringUTFChars. I now want to replace MultiBytetoWideChar with a JNI env equivalent call. Does a call exist? Is it GetStringChars?
Mr. Awesome
  • 575
  • 1
  • 6
  • 19
0
votes
1 answer

How to convert/cast a jobject into jbyte*

I would like to deal with a byte array which is retrieved from java callback function. However, I got an error 'JNIEnv' has no member named 'GetObjectElements' jmethodID FuncGetArray = GetStaticMethodID(clazz, "GetArray", "()[B"); jobject data_obj =…
Wen Hsiao
  • 631
  • 1
  • 7
  • 16
0
votes
1 answer

Call Java code from C

I use the JNI interface to invoke Java code from C code. While compiling I use the following command: gcc -g -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/include/ -I/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/include/linux/ -L/usr/bin/java…
0
votes
0 answers

Problematic frame Error in while creating JVM using JNI_CreateJavaVM routine for c

Today i get a task for calling java method by c routine.Currently i am calling a c routine by java from where i am calling a java method than i got a fatal error #A fatal error has been detected by the Java Runtime Environment: # SIGSEGV (0xb) at…
Ashish Panery
  • 1,196
  • 3
  • 13
  • 24
0
votes
1 answer

last word getting clipped/truncated in jni

I have a page of information- String When the content is in JNI (cpp dll) i am able to see the entire content, however when we see the same string in java, the last word is clipped/truncated. So in order to debug, I am trying to write the content…
user1782807
  • 151
  • 3
  • 13
0
votes
1 answer

JNI. different behavior between different Android OS versions

my application runs following code : void BmrDeviceInfo_convertToC(JNIEnv *pEnv, jobject jBmrDeviceInfo, BmrDeviceInfo& cBmrDeviceInfo){ __android_log_print(ANDROID_LOG_INFO, "BEAMER_JNI", "g_classBmrDeviceInfo is = %s", (g_classBmrDeviceInfo ==…
koleanu
  • 495
  • 5
  • 20
0
votes
0 answers

Show particular system process name on java Swing GUI List

I have a list of system processes given by following method: public native int fetchProcessIDs(int[] pids); public native String getProcessName(int hProcess); I have to show these processes on java swing GUI list.But I want to show only…
Surjit
  • 345
  • 1
  • 5
  • 13
0
votes
1 answer

Using JNI in Mono to Access Java Library

I am developing an app using mono for Android and have been strugelling to get the push notifications working, I am using Urban Airship. So far I have been able to call TakeOff() and EnablePush() and my app is successfully registering, see the…
Adrian
  • 407
  • 6
  • 20
0
votes
1 answer

set a string from c jni to java

I have a problem to set a string from jni to java class,i wrote the jni (in c) , I want to set a string from jni to java i did like this jclass cls; jmethodID mid; /* cls = (*env)->GetObjectClass(env, obj); */ cls = (*env)->FindClass…
Mr.Cool
  • 1,525
  • 10
  • 32
  • 51
1 2 3
12
13