Skip to Main Content

Java HotSpot Virtual Machine

Loading more than one library per native call

843829Sep 17 2010 — edited Sep 20 2010
Hi all,

I never really used forums before, but now I am really stuck... Ok I have a java application that needs to load several c++ libraries.

The C++ libraries are supposed to do the following prints Hello A. prints Hello B.

Java Classes
abstract class Master
public abstract void testeMyFunction(String name);

class A extends Master
A(String lib)

public native void testeMyFunction(String name);

public class Main
public static void main(String[] args) throws Exception
A a =new A("/home/filipe/workspace/TESTES/myTeste/Debug/");

A b = new A("/home/filipe/workspace/TESTES/myTeste2/Debug/");

The expected output should be:
Hello A
Hello B

However the result is Hello A Hello A :(

I believe its because it is binding the native call to the first System.load (in this case and therefore its not loading the second library properly... Is there anyway you guys can recommend to have the desired output?

Thanks a million,

Edited by: TonyCarreira on Sep 17, 2010 8:24 AM
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2010
Added on Sep 17 2010