我将java版本从java 8改为java 11,在java 11中,javah在我的pom.xml中执行javah命令之前,似乎是从JDK bin文件夹中删除的,如下所示
<execution>
<id>javah</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javah</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-d</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>既然javah已经从JDK 11中删除了,那么如何在我的pom中用javac -h替换上面的javah命令来使用java 11呢?
我得到的错误是
未能在项目org.codehaus.mojo:exec-maven-plugin:1.6.0:exec上执行目标-h (javac -h):命令执行失败。:进程退出时出错:2(退出值: 2)
有什么想法吗?谢谢
发布于 2019-01-03 10:51:04
您应该将执行修改为:
<execution>
<id>javach</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javac</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-h</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>基于javac --help
-h指定放置生成的本机头文件的位置。
https://stackoverflow.com/questions/54020303
复制相似问题