Hi,
I’m trying to use the java compiler option “–h <directory>” to generate some jni header files, but the tycho-compiler-plugin
does not seem to recognize this compiler option.
In the past we used the javah command of the jdk to generate jni headers. Since we updated our tycho to version
2.0.0 and our rcp product to 4.17 M2 (currently), we also had to update to at least JDK11. The javah command was removed from the jdk and we must use the javac –h <directory> command now. We would like to integrate this in our tycho build. As far as I now
the javac –h command does compile as usually, but additionally creates header files in the specified directory.
I’m using this snippet in the parent pom to configure the tycho-compiler-plugin:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>2.0.0</version>
<configuration>
<compilerArgs>
<compilerArg>-h ${someDirectory}</compilerArg>
</compilerArgs>
</configuration>
</plugin>
This results in the following error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:2.0.0:compile (default-compile) on project
com.example.dummy: Fatal error compiling: Unrecognized option : -h D:\someDir -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :com.example.dummy
It seems that tycho does not know the –h option of javac. Could this be easily fixed if tycho would accept the
parameter and pass it to the compiler? Or is this more complex because tycho uses the jdt compiler internally?
Is there another way to generate jni headers for bundles of a rcp build?
PS: I have asked a similar questen in the tycho-user mailing list, but unfortunately did not get a response.
Maybe the tycho developers have an answer regarding this compiler option.
Link to my tycho-user mailinglist post:
https://www.eclipse.org/lists/tycho-user/msg08632.html
Best regards
Ahmet Bilgin
Please note that our shipping and billing address and contact details including phone number have changed. Please update your records to replace our previous address: Kackertstraße 11, DE-52072 Aachen, with the
following new address: MAGMA Gießereitechnologie GmbH, Kackertstraße 16-18, DE-52072 Aachen