Java Wrapper

Want to provide feedback to MemBrain or post/discuss suggestions for improvements or new features? Detected a bug that should be resolved in a future version?

Then this is the right place for your contribution!
Post Reply
vlsd
Posts: 3
Joined: Fri 8. Apr 2016, 13:13

Java Wrapper

Post by vlsd »

I am trying to use Java Wrapper, but i keep getting errors like this

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: jnitest.MBDllWrapper.GetLastError()I
	at jnitest.MBDllWrapper.GetLastError(Native Method)
	at jnitest.JNITest.main(JNITest.java:21)
no matter what method i call.
I am running Windows 10 64 bit, tried both 32 and 64 java environments, but it still does not work. Do you have any idea why this happens?
User avatar
TJetter
Posts: 346
Joined: Sat 13. Oct 2012, 12:04

Re: Java Wrapper

Post by TJetter »

Seems like Java does not find the wrapper dll or the MemBrain dll.
Try the following:
Copy both the wrapper and the MemBrain dll files to C:\Windows\SysWOW64

I.e. the files:
- MBDllWrapper.dll
- MBDllWrapper64.dll
- MemBrainDll.dll
- MemBrainDll64.dll

All files can be found in
C:\Program Files (x86)\MemBrain\DLL

Does that help?
Thomas Jetter
vlsd
Posts: 3
Joined: Fri 8. Apr 2016, 13:13

Re: Java Wrapper

Post by vlsd »

Thanks for the reply, but that is not the case, if i remove MBDLLWrapper64.dll from "java.library.path" i get this

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: no MBDllWrapper64 in java.library.path
and if i remove MemBrainDll64.dll then this

Code: Select all

Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Windows\System32\MBDllWrapper64.dll: Can't find dependent libraries
Edit: folder C:\Windows\SysWOW64\ is not in my "java.library.path", but i think i should be able to load library from any path specified in "java.library.path" property.
User avatar
TJetter
Posts: 346
Joined: Sat 13. Oct 2012, 12:04

Re: Java Wrapper

Post by TJetter »

I suppose you have the library import directive in place?

Code: Select all

import de.membrainminusnn.MBDllWrapper;
Thomas Jetter
User avatar
TJetter
Posts: 346
Joined: Sat 13. Oct 2012, 12:04

Re: Java Wrapper

Post by TJetter »

Can you also please post the MemBrain dll and wrapper versions (just hover the mouse over the corresponding dll files in Windows Explorer)?
Thomas Jetter
vlsd
Posts: 3
Joined: Fri 8. Apr 2016, 13:13

Re: Java Wrapper

Post by vlsd »

Thank you very much

Code: Select all

import de.membrainminusnn.MBDllWrapper;
Importing class into project made it work in netbeans, i dont know how to add class normally in ide i'm working in, but now i know the cause of my problem.
Thanks again, you helped a lot!!!
Post Reply