wood burning stoves
The moose likes Java in General and the fly likes Calling DLL function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Calling DLL function" Watch "Calling DLL function" New topic

Calling DLL function

Sahil Sharma
Ranch Hand

Joined: Aug 27, 2003
Posts: 152

How can I call a dll function from a java class ?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Try J/Direct

[My Blog]
All roads lead to JavaRanch
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
All I can find on J/Direct is a feature of the Microsoft JVM or JDirect (with no slash) for Apple. Is there something else I'm missing?

JNI is the usual Java technology for this. You have to make a custom DLL that understands JNI but it can call any other DLL through standard calls.

Java -> JNI -> Custom DLL -> Call -> other DLL

You can also Google for "java com bridge" and find a number of free and commercial products that will do COM calls. The quality and price varies termendously.
[ December 28, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

I believe the engineer is capable enough of giving custom DLL so you don't need to follow long hiearchy.
Java -> JNI -> Custom DLL -> Call -> other DLL

JNI->Custom DLL is enough

JNI is a efficient solution then trying anything else.

The other efficietn way of doing, avoid DLL and go for webservice.
So java webservice calls the other technology webservice.
Rick O'Shay
Ranch Hand

Joined: Sep 19, 2004
Posts: 531
Originally posted by Sahil Sharma:

How can I call a dll function from a java class ?

I agree. Here's the link: http://aspose.com/file-tools
subject: Calling DLL function
It's not a secret anymore!