我在使用Maven exec插件来执行javah工具时遇到了问题。我试图将输出目录指定为javah,其中将放置头文件,但我得到了错误:
信息-- exec-maven-plugin:1.5.0:exec (创建-jni-headers)@ jni-test-osgi -错误:未知选项:-d /home/kerry错误命令执行失败。
这是“行动纲领”的有关部分:
<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插件有问题?
发布于 2016-08-30 18:06:43
每一个“论点”都必须有自己的台词:
<argument>-d</argument>
<argument>/home/kerry</argument>
<argument>com.javatechnics.jni.test.osgi.HelloWorld</argument>否则它就会像
javah "-d /home/kerry" com.javatechnics.jni.test.osgi.HelloWorld其中"-d /home/kerry“是javah命令未知的单个参数。因此出现了错误。
https://stackoverflow.com/questions/39234208
复制相似问题