JDK-8257852 : ☂ : Remove JNF dependencies from java.desktop module
  • Type: Task
  • Component: client-libs
  • Affected Version: 17
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2020-12-07
  • Updated: 2021-08-24
  • Resolved: 2021-02-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
JavaNativeFoundation is a macOS framework which contains a number
of different types of convenience support for Java applications that use
native methods.
Some of this is related to the Cocoa framework but a lot of it has nothing
to do with macOS and is just a layer of conveniences that aren't needed.
It is quite small as these things go but I doubt we are even using all of that.
Even the cocoa support isn't anything that is needed since OpenJFX
manages just fine without it.
It has recently been open-sourced but is not likely to be maintained since
it is also deprecated so for the long term the best answer is to remove dependencies on it.

There are  61 files in the java.desktop module that import JNF as
determined by :
#import <JavaNativeFoundation/JavaNativeFoundation.h>

These amount to around 1300 references to JNF - removing these looks
to be mostly tedious rather than difficult. 
Most of the uses are in AWT code with a smattering of 2D
To make reviews manageable I propose to break it up into smaller pieces of work - mostly by category - before finally removing references to JNF from the build - which will require  also updating just 3 files outside of the desktop module. 
Comments
All related work has been done, although there may be a bug tail.
04-02-2021

JNF framework is also intel-only in macos BigSur
10-12-2020