diff --git a/WHATSNEW b/WHATSNEW index e60ac6ccb..6037fe6ee 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -87,6 +87,10 @@ Other changes: * a new implementation "forking" has been added to and is used as default when running on JDK9. + * support for javac's -h switch has been added with the + nativeheaderdir attribute. + Bugzilla Report 59905 + Changes from Ant 1.9.6 TO Ant 1.9.7 =================================== diff --git a/manual/Tasks/javac.html b/manual/Tasks/javac.html index a5fc56cfc..202215f70 100644 --- a/manual/Tasks/javac.html +++ b/manual/Tasks/javac.html @@ -125,6 +125,15 @@ classpath of the <javac> task, and does not release them. The side effect of this is that you will not be able to delete or move those files later on in the build. The workaround is to fork when invoking the compiler.

+

If you are using Java 8 or above and your source contains native + methods or fields annotated with the @Native annotation + you can set the nativeheaderdir attribute in order to + use the -h switch of javac to generate the + native header files. Note that the logic Ant uses to determine which + files to compile does not take native headers into account, i.e. if + the .class is more recent than the + corresponding .java file the file will not get compiled + even if a native header file generated for it would be outdated.

Parameters

@@ -505,6 +514,14 @@ invoking the compiler.

since Ant 1.9.7 + + + +
No
nativeheaderdir + Specify where to place generated native header files. Ignored + when running on JDK < 8. + Since Ant 1.9.8. + No

Parameters specified as nested elements

diff --git a/manual/Tasks/javah.html b/manual/Tasks/javah.html index 2958a2db6..bc49d77da 100644 --- a/manual/Tasks/javah.html +++ b/manual/Tasks/javah.html @@ -33,6 +33,14 @@ whether pre-JDK1.2 systems are used.

+

If you are building with Java 8 or above consider + using javac's nativeheaderdir + attribute instead which allows you to compile the classes and + generate the native header files with a single step.

+ +

Note the javah has been deprecated as of Java 9 + and is scheduled to be removed with Java 10.

+

It is possible to use different compilers. This can be selected with the implementation attribute or a nested element. Here are the choices of the attribute:

diff --git a/manual/Tasks/rmic.html b/manual/Tasks/rmic.html index 3c7a6d643..fa927bf8d 100644 --- a/manual/Tasks/rmic.html +++ b/manual/Tasks/rmic.html @@ -53,7 +53,7 @@ attribute. or a nested element. Here are the choices: