Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing .NET/dll libraries/components from Java?

Tags:

java

.net

Are there inexpensive or free gateways from .NET to Java? I'm looking at some data acquisition hardware which has drivers for C/C++ and .NET -- I really don't want to do any programming in .NET.

Update: I haven't done what I originally wanted to do, but I've done something similar, using JNA to encapsulate some functions from a DLL, in order to control a USB hardware device from Java. (the DLL comes from the device manufacturer) It works really nicely. Thanks!

like image 417
Jason S Avatar asked Jan 07 '09 15:01

Jason S


1 Answers

You could also try to use JNA for accessing the native library. JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. If their API is fairly straight foward, this might be the path of least resistance.

See their getting started guide where they call some native code (printf and GetSystemTime).

like image 186
Steve K Avatar answered Sep 19 '22 23:09

Steve K