Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sun.awt.SunToolkit awt.dll: Can't find dependent libraries #32

Closed
DezW opened this issue Dec 12, 2019 · 9 comments
Closed

sun.awt.SunToolkit awt.dll: Can't find dependent libraries #32

DezW opened this issue Dec 12, 2019 · 9 comments
Labels
bug Something isn't working Waiting on OP wontfix This will not be worked on

Comments

@DezW
Copy link

DezW commented Dec 12, 2019

Platform:
Windows

Architecture:
64 bit

When using OpenJDK8U-jre_x64_windows_hotspot_8u232b09\jdk8u232-b09-jre, an exception is thrown when trying to get the print services because there are missing dependencies for awt.dll

When calling the PrintServiceLookup.lookupPrintServices method from within a unit test, this issue is not observed but when a service is started and tries to call this, the stack trace is created ...

Exception in thread "AbstractPortMapper.InetService" Exception in thread "AbstractPortMapper.InetService" java.lang.UnsatisfiedLinkError: awt.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1838)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at java.awt.Toolkit$3.run(Toolkit.java:1636)
at java.awt.Toolkit$3.run(Toolkit.java:1634)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
at java.awt.Toolkit.(Toolkit.java:1670)
at sun.awt.AppContext$2.run(AppContext.java:277)
at sun.awt.AppContext$2.run(AppContext.java:266)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(AppContext.java:266)
at sun.awt.AppContext.access$400(AppContext.java:135)
at sun.awt.AppContext$3.run(AppContext.java:321)
at sun.awt.AppContext$3.run(AppContext.java:304)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(AppContext.java:303)
at javax.print.PrintServiceLookup.getServicesForContext(PrintServiceLookup.java:78)
at javax.print.PrintServiceLookup.getListOfLookupServices(PrintServiceLookup.java:87)
at javax.print.PrintServiceLookup.getAllLookupServices(PrintServiceLookup.java:331)
at javax.print.PrintServiceLookup.getServices(PrintServiceLookup.java:371)
at javax.print.PrintServiceLookup.lookupPrintServices(PrintServiceLookup.java:123)

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.SunToolkit
at sun.awt.AppContext$2.run(AppContext.java:277)
at sun.awt.AppContext$2.run(AppContext.java:266)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(AppContext.java:266)
at sun.awt.AppContext.access$400(AppContext.java:135)
at sun.awt.AppContext$3.run(AppContext.java:321)
at sun.awt.AppContext$3.run(AppContext.java:304)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(AppContext.java:303)
at javax.print.PrintServiceLookup.getServicesForContext(PrintServiceLookup.java:78)
at javax.print.PrintServiceLookup.getListOfLookupServices(PrintServiceLookup.java:87)
at javax.print.PrintServiceLookup.getAllLookupServices(PrintServiceLookup.java:331)
at javax.print.PrintServiceLookup.getServices(PrintServiceLookup.java:371)
at javax.print.PrintServiceLookup.lookupPrintServices(PrintServiceLookup.java:123)

This is not a problem in OpenJDK8U-jre_x64_windows_hotspot_8u202b08\jdk8u202-b08-jre

@sxa sxa transferred this issue from adoptium/temurin-build Dec 13, 2019
@sxa sxa added the bug Something isn't working label Dec 13, 2019
@sxa sxa added this to Needs triage in openjdk-support via automation Dec 13, 2019
@karianna
Copy link
Contributor

karianna commented Jan 8, 2020

@DezW - Is this the case with the adoptopenjdk.net/upstream.html build as well?

@karianna karianna moved this from Needs triage to Low priority in openjdk-support Jan 8, 2020
@DezW
Copy link
Author

DezW commented Jan 8, 2020

@karianna This is not the case in the upstream build of the same version.

@karianna
Copy link
Contributor

karianna commented Jan 9, 2020

FYI - for the next investigator, this is likely due to a difference in the MSFT VS toolchain that we use.

@paulfc
Copy link

paulfc commented Mar 4, 2020

I appear to be running into this issue with OpenJDK8U-jdk_x64_windows_hotspot_8u242b08 but not the upstream Red Hat builds?

@karianna
Copy link
Contributor

karianna commented Mar 6, 2020

adoptium/temurin-build#1026 and friends

@aahlenst
Copy link
Contributor

aahlenst commented Jul 2, 2020

@DezW or @paulfc Please provide a minimal example that reproduces the problem. Otherwise it's hard to track whether we've fixed the problem or not.

@paulfc
Copy link

paulfc commented Jul 2, 2020

@DezW or @paulfc Please provide a minimal example that reproduces the problem. Otherwise it's hard to track whether we've fixed the problem or not.

It would take me a while to extract a test case, however, I would be more than happy to test an Alpha/RC binary if that would help?

In the meantime, I'll try to put together an example

@aahlenst
Copy link
Contributor

Closing due to lack of requested feedback. We're happy to reopen the issue if feedback is provided by the OP (or anybody else) at a later date.

openjdk-support automation moved this from Low priority to Closed Jul 31, 2020
@karianna karianna added the wontfix This will not be worked on label Jul 31, 2020
@rgra
Copy link

rgra commented Apr 26, 2021

It might help others to list what I did to solve the issue:

I had the same issue. A library (Eclipse BIRT) we are using in our webapplication running on Tomcat, is using java.awt.Color.
It did run fine on Oracle JDK, but not on AdoptOpenJDK 8.
Error was:
Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\AdoptOpenJDK\jdk-8.0.292.10-hotspot\jre\bin\awt.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) ~[?:1.8.0_292] at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934) ~[?:1.8.0_292] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1838) ~[?:1.8.0_292] at java.lang.Runtime.loadLibrary0(Runtime.java:871) ~[?:1.8.0_292] at java.lang.System.loadLibrary(System.java:1124) ~[?:1.8.0_292] at java.awt.Toolkit$3.run(Toolkit.java:1636) ~[?:1.8.0_292] at java.awt.Toolkit$3.run(Toolkit.java:1634) ~[?:1.8.0_292] at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_292] at java.awt.Toolkit.loadLibraries(Toolkit.java:1633) ~[?:1.8.0_292] at java.awt.Toolkit.<clinit>(Toolkit.java:1670) ~[?:1.8.0_292] at java.awt.Color.<clinit>(Color.java:275) ~[?:1.8.0_292]

I used the tool "dependencies" a fork of "dependency walker" to see what dependencies awt.dll needs. It showed that it couldn't find jvm.dll. I added the path C:\Program Files\AdoptOpenJDK\jdk-8.0.292.10-hotspot\jre\bin to the PATH Environment variable, and now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting on OP wontfix This will not be worked on
Projects
No open projects
openjdk-support
  
Closed
Development

No branches or pull requests

6 participants