Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Calling windows APIs from inside Java ?

  Asked By: Harley    Date: Apr 21    Category: Java    Views: 930

Try JACOB (Java-COM-Bridge , available via sourceforge).
it solved my problem once.



2 Answers Found

Answer #1    Answered By: Beaudi Smith     Answered On: Apr 21

You can create a dll file with delphi or ... and then write a method that call your API in dll unit.
After compile dll file you can use this dll in java  class with System.load(DllPath)
and declare a native method isotope to dll method and then call it.

Answer #2    Answered By: Sophia Campbell     Answered On: Apr 21

Calling OS-native code from Java is a little bit difficult. Depending on your way of thought this might be good or bad. You might consider this good, because Java apps are supposed to run on many different platforms. So the more difficult calling  OS-native code, the less platform-dependent apps are written.

Anyways. The low-level method of calling OS-native code from Java apps is JNI. It is difficult. You have to write native code (most probably in C/C++) to be able to call OS-native code.

There are APIs available that make it easier to call OS-native code. One instance is JNIWrapper by TeamDev ( www.jniwrapper.com/pages/jniwrapper/overview). You might also want to consider using ComfyJ ( ( http://www.jniwrapper.com/pages/comfyj/overview). Open source alternatives are also available but I can't remember them right now.

Didn't find what you were looking for? Find more on Calling windows APIs from inside Java ? Or get search suggestion and latest updates.