Emmeran Seehuber created PDFBOX-4013:
----------------------------------------

             Summary: Java 9/macOS: Debugger App does not start 
(NoSuchMethodException)
                 Key: PDFBOX-4013
                 URL: https://issues.apache.org/jira/browse/PDFBOX-4013
             Project: PDFBox
          Issue Type: Bug
          Components: Utilities
    Affects Versions: 2.0.8
            Reporter: Emmeran Seehuber


It seems the debugger app wants to integrate nicely into macOS and uses some 
private API for this. This worked fine with all Java versions including 8, but 
does no longer work with 9.

Java 9 provides new APIs for this, but till PDFBox can depend on Java 9 (or the 
next LTS Java 11) it should at least catch this and not crash....

The application does not start, and instead displays a dialog with a stack 
trace.

Console Output + StackTrace:
{code}
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.pdfbox.debugger.ui.OSXAdapter 
(file:/Users/emmy/Downloads/debugger-app-2.0.7.jar) to constructor 
com.apple.eawt.Application()
WARNING: Please consider reporting this to the maintainers of 
org.apache.pdfbox.debugger.ui.OSXAdapter
WARNING: Use --illegal-access=warn to enable warnings of further illegal 
reflective access operations
WARNING: All illegal access operations will be denied in a future release
Mac OS X Adapter could not talk to EAWT:

java.lang.RuntimeException: java.lang.NoSuchMethodException: 
com.apple.eawt.Application.addApplicationListener(com.apple.eawt.ApplicationListener)
    org.apache.pdfbox.debugger.ui.OSXAdapter.setHandler(OSXAdapter.java:171)
    org.apache.pdfbox.debugger.ui.OSXAdapter.setFileHandler(OSXAdapter.java:137)
    org.apache.pdfbox.debugger.PDFDebugger.initComponents(PDFDebugger.java:301)
    org.apache.pdfbox.debugger.PDFDebugger.<init>(PDFDebugger.java:182)
    org.apache.pdfbox.debugger.PDFDebugger.main(PDFDebugger.java:1201)
Caused by: java.lang.NoSuchMethodException: 
com.apple.eawt.Application.addApplicationListener(com.apple.eawt.ApplicationListener)
    java.base/java.lang.Class.getDeclaredMethod(Class.java:2432)
    org.apache.pdfbox.debugger.ui.OSXAdapter.setHandler(OSXAdapter.java:163)
    org.apache.pdfbox.debugger.ui.OSXAdapter.setFileHandler(OSXAdapter.java:137)
    org.apache.pdfbox.debugger.PDFDebugger.initComponents(PDFDebugger.java:301)
    org.apache.pdfbox.debugger.PDFDebugger.<init>(PDFDebugger.java:182)
    org.apache.pdfbox.debugger.PDFDebugger.main(PDFDebugger.java:1201)
{code}

To workaround this problem I have to run the debugger app using JDK 8. This is 
ok for now, but very annoying.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to