cancel
Showing results for 
Search instead for 
Did you mean: 

How to use system dll in java

Former Member
0 Kudos

Hi,

I have to use a system dll(kernel32.dll) in my java program.can pls tell me the way to use it.can u pls send me the sample code if any.

Regards,

kiran.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

You can use System.loadLibrary() and put the DLL in the path

for ex : you have test.dll

add this to the classpath and call System.loadLibrary("test") ;

alternatively you can also use

System.load("c:/path/to/dll/test.dll");

Hope this helps ,please mark points for helpful answers

regards

rajesh kr

Former Member
0 Kudos

Hi,Thanks for the reply.

But i want to use the methods in it to get some important details like physical memory etc.So pls tell me the way of using it.If possible send me tyhe sample code.

Regards,

Kiran.

Former Member
0 Kudos

Hi

You have to use JNI and java to do any native method calls in java .

Here are some sample tutorials

http://bdn.borland.com/article/0,1410,20679,00.html

http://www.inonit.com/cygwin/jni/helloWorld/load.html

http://www.kbalertz.com/kb_222092.aspx

hope this helps ,please mark helpful answers

regards

rajesh kr