Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multiple Classes within a DLL?

843829Aug 12 2005 — edited Aug 23 2005
I have a DLL with several classes in it. I want to be able to call the methods on the different classes. When I try and call a method in one of the classes I get a UnsatisfiedLinkError.

For example, lets say my DLL called Animals.dll has 2 classes, Cat and Dog in it. Both have methods makeNoise(); I want to be able to call either one. How do I declare the native methods for these?

public native void makeNoise();

will not do as 2 classes implement that method.

All the examples online deal with a simple DLL that has methods only, therefore only one class. Also the examples assume the java file is created first, then the .h file using javah, and then the dll is made. However in my case I already have the DLL and need to write a java program to access the classes and methods in the DLL.

I've tried searching for resources online but havent found any. If you know of any please let me know.

Thanks in advance for the help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 20 2005
Added on Aug 12 2005
6 comments
274 views