javah的使用方法
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18703185/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use javah
提问by Tagc
I've just wasted 2 hours trying to do something which I've already done twice before. I can't remember the exact procedure I used the previous two times, but it really shouldn't be giving me this much trouble:
我只是浪费了 2 个小时试图做一些我之前已经做过两次的事情。我不记得我前两次使用的确切程序,但它真的不应该给我带来这么多麻烦:
I have a project folder called "BoardGUIv3". I want to produce a header file based on a class called "CANController", with the source located in "BoardGUIv3/src/model" and the class file in "BoardGUIv3/bin/model".
我有一个名为“BoardGUIv3”的项目文件夹。我想基于名为“CANController”的类生成一个头文件,源文件位于“BoardGUIv3/src/model”中,类文件位于“BoardGUIv3/bin/model”中。
I've done exactly this thing before, but for some reason I can't seem to do this simple, one-line command again.
我以前确实做过这件事,但由于某种原因,我似乎无法再次执行这个简单的单行命令。
I'm pretty sure it's something along the lines of
我很确定它是类似的东西
javah -classpath <classpath> src/model/CANController
My classpath should just be the root directory, shouldn't it?
我的类路径应该只是根目录,不是吗?
采纳答案by Juned Ahsan
Here is the javah command usage:
这是 javah 命令的用法:
{javahLocation} -o {outputFile} -classpath {classpath} {importName}
and it should be used like this for you class:
它应该像这样用于您的课程:
javah -o "CANController.h" -classpath "C:\pathToYourProjDir\BoardGUIv3\bin" model.CANController
Just correct the path to your classfile with the real path and the package structure if required.
如果需要,只需使用真实路径和包结构更正类文件的路径。