jni

Creating multiple thread in JVM to fulfil high user load

I have a C program that will be storing and retrieving alot of data in a Java store. I am putting alot of stress in my C program and multiple threads are adding and retrieving data from Java store. How will java handle such load? Because if there is only one main thread running JVM and handling all the requests from C, then it may become...

Retrieving byte array of unknow length from Java store

I already posted a question regarding it, but at that time I haven't have the account. I got a reply but I was still confused and I cannot continue on that thread. I am re posting the question again along with a link to previous conversation. Returning char array from java to string - JNI The data I am storing in Java is serialized. I...

How to replace a dynamic library loaded in a Java Applet without requiring a full browser restart?

Hi, I'm writing a self-updating application. The first time it runs, it installs a native library on the client's computer, so that they don't need to download it every time. When it detects that the installed library's version is older than the new required minimum, it downloads and installs the new one. The problem is, the new librar...

When and how are NIO direct buffers freed?

I have a C library that wants a temporary buffer for scratch space. I'm considering passing the address of a direct byte buffer to it. Is the VM ever allowed to relocate the buffer before it is ultimately freed? The native library will be holding on to the pointer after the JNI frame goes away. My understanding is that JNI local objec...

How to call a JNI DLL from C++

I have a task to interface with a dll from a third party company using C++. The dll package comes with: the dll itself a sample Java implementation - consists of a java wrapper(library) generated using the SWIG tool and the the java source file documentation that states all the public datatypes, enumeration and member functions. My ...

FATAL ERROR in JNI code - presumably in JDIC library

I am using a Java coded desktop application to track my time on projects. I used it until the IT did a new setup on my station. And now I cannot launch this application. I got a log file when I launch it saying: # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d...

How do you use Objective-C starting from the "Java JNI Application" template in XCode?

I want to use the NSStatusBar object from my Java application using JNI. I know there's some existing libraries out there but I've tried them and they don't have the correct drop down menu. I'm starting from the "Java JNI Application" template in XCode and I simply put NSString *str=@""; to see if it could compile but this produces ...

Debugging the JNI code in VisualStudio 2003

How to debug the JNI code in VisualStudio 2003 without using eclipse? ...

Problem loading quaqua 64 libraries

Everytime my app loads I get the following error in the console: Warning: class ch.randelshofer.quaqua.osx.Application couldn't load library "quaqua64". java.lang.UnsatisfiedLinkError: no quaqua64 in java.library.path I thought this would be resolved by adding libquaqua64.jnlib to the resource directory that contian my libquaqua.jnli...

Debugging the JNI Source code in visual studio 2003 without using eclipse?

In visual studio 2003's project settings, I specified the java.exe as the program to execute when debugging. I set the working directory in which the JNI dlland JNI jar is available. I set the class paths and the command line arguments which I would pass to java in the program arguments. The java file which I am using is compiled with ...

Java Native Interface and Security

Is there any chance for the the violation of java security policy through java native interface. Which are the main areas we have to use JNI ...

Howto make Java JNI KeyListener with C++

I'm trying to make a program like AutoHotKey, but with a graphical interface. I'm using java.awt.Robot Now I want to make the code for checking the state from a key (In AHK: getKeyState) Of course somthing like a KeyListener without having focus. I read already something with JNI and C++, but.... I can't find some information. Can someb...

Memory leak when calling java code from C using JNI

Hi, I have a C program that stores some object in java store using JNI. (Before someone ask, using java store is a requirment here and I have to write a client in C which would be able to add and retrieve objects from this store). I made the program and tried to add 100000 object of size 1KB. But after adding only 50000 objects I am get...

Java LoadLibrary UnsatisfiedLinkError, though Java can see the file and runs on another computer

Hi All: This problem is really befuddling me and hopefully someone could help me out. I've written some plugin libraries for a large java software. Everything works fine and well on my development computer. However, after I compiled and wrapped the software in Nullsoft Installer and install onto another computer, everything but the nat...

JNI Hello World Unsatisfied Link Error

This is my first attempt at JNI. My ultimate goal is to get all tasks currently running on a machine, but need to get even a simple example running. I keep getting this error when I try to execute my main program. I have supplied my simple Java main program, the header file generated, and the error. I do not know what this DLL could be ...

How to fix Java JNI DLL dependencies

Hi, I have a Java Application which has to load an DLL with a few dependencies. I copied all required DLLs in the same folder. The DLL I was set up uses the SeeingMachine FaceApi libraries. Now when I'm starting the Java application I will get an error the my DLL can't find the dependencies: Exception in thread "main" java.lang.Unsatis...

callbacks in jni

Is there any way to pass a callback to java code, from C. And the call returns immediately. Later on, after completing the task, the java code can invoke that callback. I have a C extension for php that calls a java store to store some items in it. The items can be retrieved from store in synchronous and asynchronous methods (I provide...

Disadvantages of using Java Native Interface

I can not get these two disadvantages of using JNI. I want to know more about them: Difficult to debug runtime error in native code Errors in JNI code take down the entire JVM and don't provide any mechanism for graceful recovery ...

java.lang.UnsatisfiedLinkError no *****.dll in java.library.path

How can I load a custom dll file in my web application? I tried following ways but its failing. copied all required dlls in system32 folder and tried to load one of them in Servlet constructor System.loadLibrary Copied required dlls in tomcat_home/shared/lib and tomcat_home/common/lib all these dlls are in WEB-INF/lib of the web-applic...

J++ to Java: how to migrate from RNI to JNI?

I've inherited a legacy J++ project. I've upgraded this project to standard Sun Java successfully. However, this project includes a native C++ dll which the Java code talks to via the Microsoft-specific RNI framework. Needless to say, calling System.loadLibrary("myRniNativeDll") now throws a UnsatisifiedLinkError, saying one of the dep...