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.
Asked
Active
Viewed 465 times
0
1 Answers
4
- Build your java interface in eclipse. (myInterface.java)
call: javah -jni com.mypackage.myInterface
A com_mypackage_myInterface.h will be built for you in your classes folder.
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
Compile your c++ project so a dll (or .so) file is generated
Copy the dll back into your Java project (lib or WEB-INF/lib folder).
Have a static call to load your dll ...
static { System.loadLibrary("MYINTERFACE");// DLL created }

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