I used the following guide to get started, http://cnd.netbeans.org/docs/jni/beginning-jni-win.html.
But when I try to generate the header file us开发者_如何学Going the command below
JAVA_HOME\bin\javah.exe -o HelloWorldNative.h -jni -classpath PROJECTS_ROOT\HelloWorld\build\classes helloworld.Main
I get the following error.
Error: Can't recover from an I/O error with the following message: HelloWorldNative.h (access denied)
Thanks in advance :)
Looks to me like you are standing in a directory where you are not granted write access when you run javah.
Edit: What if you specify a full path to somewhere you know you have write access?
I also got that problem and this is how I solved it:
After building your project,go to the directory where your .class files are.
e.g C:\Users\Development\Documents\NetBeansProjects\DLLDevelopment\build\classes
and run your command again.
精彩评论