JDK-8259232 : Bad JNI lookup during printing
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2021-01-05
  • Updated: 2025-01-13
  • Resolved: 2021-01-06
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 11 JDK 13 JDK 15 JDK 17 JDK 8
11.0.12-oracleFixed 13.0.8Fixed 15.0.4Fixed 17 b05Fixed 8u321Fixed
Related Reports
Relates :  
Description
While running test/jdk/java/awt/print/bug8023392/bug8023392.html with latest jdk I see that we are getting error and test quits
===========
Bad JNI lookup fPrinterJob
java.lang.NoSuchMethodError: Lsun/lwawt/macosx/CPrinterDialog;.fPrinterJobLsun/lwawt/macosx/CPrinterJob;
        at java.desktop/sun.lwawt.macosx.CPrinterJobDialog.showDialog(Native Method)
        at java.desktop/sun.lwawt.macosx.CPrinterDialogPeer.lambda$setVisible$0(CPrinterDialogPeer.java:58)
        at java.base/java.lang.Thread.run(Thread.java:831)
STATUS:Failed.Applet thread threw exception: java.lang.NoSuchMethodError: Lsun/lwawt/macosx/CPrinterDialog;.fPrinterJobLsun/lwawt/macosx/CPrinterJob;
======
This seems to be a regression from jdk17b03 onwards and it looks to be caused by JDK-8257853
Comments
Fix request (11u) This is the part bugfixes for removing JNF dependency from jdk11u. Applies cleanly. Also needed for parity with oracle.
18-05-2021

Fix request (15u). I'd like to backport this fix to jdk15u for parity with jdk11u. I observe the same error running test/jdk/java/awt/print/bug8023392/bug8023392. After applying the patch the bug is eliminated. The original patch applied cleanly.
15-04-2021

Fix request (13u). I'd like to backport this fix to jdk13u for parity with jdk11u. I observe the same error running test/jdk/java/awt/print/bug8023392/bug8023392. After applying the patch the bug is eliminated. The original patch applied cleanly.
15-04-2021

Changeset: 940b0530 Author: Phil Race <prr@openjdk.org> Date: 2021-01-06 17:34:15 +0000 URL: https://git.openjdk.java.net/jdk/commit/940b0530
06-01-2021

Typo GET_METHOD_RETURN(sjm_printerJob, sjc_CPrinterDialog, "fPrinterJob", "Lsun/lwawt/macosx/CPrinterJob;", ret); should be GET_FIELD_RETURN(sjm_printerJob, sjc_CPrinterDialog, "fPrinterJob", "Lsun/lwawt/macosx/CPrinterJob;", ret);
05-01-2021