问题描述
我只是浪费了2个小时试图做一些我以前做过两次的事情。我记不起前两次使用的确切程序了,但它确实不应该给我这么多麻烦:
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:
我有一个项目文件夹叫做 BoardGUIv3\" 。我想基于一个名为CANController的类生成一个头文件,源代码位于BoardGUIv3 / src / model中,类文件位于BoardGUIv3 / bin / model中。
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".
我以前做过这件事,但由于某种原因,我似乎无法再做这个简单的单行命令。
I've done exactly this thing before, but for some reason I can't seem to do this simple, one-line command again.
我很确定这是符合
javah -classpath <classpath> src/model/CANController
我的类路径应该只是根目录,不应该吗?
My classpath should just be the root directory, shouldn't it?
推荐答案
以下是javah命令用法:
Here is the javah command usage:
{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.
这篇关于如何使用javah的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!