Minor thoughts (Re: [External] : Re: JEP draft: Prepare to Restrict The Use of JNI

Simon Nash simon at cjnash.com
Wed Sep 6 16:21:05 UTC 2023


On 06/09/2023 12:36, Ron Pressler wrote:
> Why? You can now easily pick whichever runtime you want (a minimal one is only 40MB!) and not require the end user to install Java or even know that your application is written in Java. Also, the proposed change would have no impact on anyone using a client JRE (8 is the *highest* version for which a JRE is available).
The application needs to run on Mac ARM64 machines (for example), so requiring the user to use Java 8 is not an option. On some headless NAS platforms the 
application is packaged with a minimal Java runtime but desktop platforms with a graphical interface require most of the full JDK.
> If you opt not to choose the runtime and the user updates the runtime, the warning will correctly indicate that the application will need to be updated in order to run on future runtimes.
This sounds like a good idea except that the wording of the current messages doesn't achieve this objective when the messages are seen by a non-technical user. 
To achieve this objective without scaring such a user, the messages should be something like this:
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -
This application is using the Java Native Interface (JNI).
No action is required at the present time.
It is possible that the application might need to be updated to run on some future version of Java.
-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -

The detailed messages that are currently proposed showing which packages / modules / called methods / calling methods are involved could be useful for 
developers, so there should be a command-line option for a developer to to enable these. Something like this was provided for "illegal access" warnings in Java 9.

Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20230906/ddd445b0/attachment.htm>


More information about the jdk-dev mailing list