• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Little problem with JNI and arrays  RSS feed

Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm trying to do some array operation with JNI. I want the native code to do produce some array content and update it to java array, but I want it to obtain copy once, and only update content later multiple times.

So I did it this way i c:

and Java code looks like:

(of course library is already loaded at this point)

and I get FATAL ERROR (ACCESS VIOLATION) in Java_jni_Shit_commit
althrough if I call Java_jni_Shit_commit inside native Java_jni_Shit_init then it works.
So, I think I've missed something... why I can't just do release in another JNI call?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!