First compile your java source into a class file (inside your ide or with javac). Then run the javah program on the class file. This javah program will generate the function declarations into a C/C++ header file. Use this header to implement/export the functions in your DLL.
Example:
_package/X.java:
package _package;
public class X
{
public native int func(float f, boolean b);
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
We run the following commands outside the _package directory:
javac _package/*.java
javah _package.X
After running these commands you will find a _package_X.h file in the current dir.