Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-dev] Tycho compiler option for generating jni headers

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

 

 

cid:magma_logo_600x600px_2bf73d82-7e11-4b48-882e-15c123d86981.png

Ahmet Bilgin, M.Sc.
Software Development

MAGMA Gießereitechnologie GmbH

P: +49 241 88901 203 
Kackertstrasse 16-18, 52072 Aachen, Germany 
www.magmasoft.de
a.bilgin@xxxxxxxxxxxx


 GERMANY ● USA ● BRAZIL ● SINGAPORE ● SOUTH KOREA ● CHINA ● INDIA ● TURKEY ● CZECH REPUBLIC

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

MAGMA Gießereitechnologie GmbH | Kackertstraße 16-18, 52072 Aachen, Germany | Legal form: GmbH, Register court: Aachen HRB 3912, Value added tax identification number: DE121745780 | Management: Dr. Marc C. Schneider (CEO and President), Dr.-Ing. Jörg C. Sturm (Managing Director)


Back to the top