0

I am trying to develop keylogger application that contains a mix of Java and C++ code. But I don't know how to deploy it in Eclipse IDE. Where I have to put the .dll, .lib and C++ files inside the Java project.

Onur A.
  • 3,007
  • 3
  • 22
  • 37
Sukesh K
  • 31
  • 1
  • 5

1 Answers1

4
  1. Build your java interface in eclipse. (myInterface.java)
  2. call: javah -jni com.mypackage.myInterface

    A com_mypackage_myInterface.h will be built for you in your classes folder.

  3. Move the com_mypackage_myInterface.h into your c++ project and use that to code your c++ implementation. Do not change anything in your .h file

  4. Compile your c++ project so a dll (or .so) file is generated

  5. Copy the dll back into your Java project (lib or WEB-INF/lib folder).

  6. Have a static call to load your dll ...

    static { System.loadLibrary("MYINTERFACE");// DLL created }

Micho Rizo
  • 1,000
  • 3
  • 12
  • 27