开发者

Problem using JNI - Error when generating header file

开发者 https://www.devze.com 2023-03-01 14:44 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消