首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >通过Maven exec插件执行javah失败

通过Maven exec插件执行javah失败
EN

Stack Overflow用户
提问于 2016-08-30 18:01:42
回答 1查看 634关注 0票数 0

我在使用Maven exec插件来执行javah工具时遇到了问题。我试图将输出目录指定为javah,其中将放置头文件,但我得到了错误:

信息-- exec-maven-plugin:1.5.0:exec (创建-jni-headers)@ jni-test-osgi -错误:未知选项:-d /home/kerry错误命令执行失败。

这是“行动纲领”的有关部分:

代码语言:javascript
复制
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>create-jni-headers</id>
            <goals>
                <goal>exec</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
                <executable>javah</executable>
                <workingDirectory>${project.build.outputDirectory}</workingDirectory>
                <arguments>
                    <argument>-d /home/kerry</argument>
                    <argument>com.javatechnics.jni.test.osgi.HelloWorld</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

如果我从命令行执行javah -d /home/kerry com.javatechnics.jni.test.osgi.HelloWorld,那么就没有问题了。

我是不是做错了什么,还是Maven exec插件有问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-30 18:06:43

每一个“论点”都必须有自己的台词:

代码语言:javascript
复制
<argument>-d</argument>
<argument>/home/kerry</argument>
<argument>com.javatechnics.jni.test.osgi.HelloWorld</argument>

否则它就会像

代码语言:javascript
复制
javah "-d /home/kerry" com.javatechnics.jni.test.osgi.HelloWorld

其中"-d /home/kerry“是javah命令未知的单个参数。因此出现了错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39234208

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档