Minor thoughts (Re: [External] : Re: JEP draft: Prepare to Restrict The Use of JNI
Chris Hegarty
chegar999 at gmail.com
Tue Sep 5 13:27:46 UTC 2023
Hi Rony,
On 05/09/2023 11:42, Rony G. Flatscher wrote:
>
> On 05.09.2023 11:49, Chris Hegarty wrote:
>> ...
>>
>> FWIW, I like the alignment JNI and the FFM API, in this respect. Both
>> old and new are treated in a similar way.
>>
> Employing the FFM API may be something that an application author may
> not realize unless he is made aware of it one way or another.
>
> Employing JNI is different, the application author needs to be aware
> of it if assembling the application for different platforms and
> architectures where you need different precompiled native libraries.
Having both authored code using the FFM API and assembled applications
levering JNI, I can only say that I am well aware of the implications. I
don't see it all that different - other than the obvious difference
between platform dependent Java code compared to platform dependent
native code, and the packaging of such.
> To make sure that the application author is aware of native access,
> these warnings could be issued by the compiler and/or jlink, unless
> the flag is supplied.
Yes possibly, but as I see it this is more of a run-time concern rather
than compile or build time. I'm not saying that such would not be
useful, but its secondary.
-Chris.
More information about the jdk-dev
mailing list