I’ve encountered a sudden error in my Java + Spring Boot project, which I am developing in IntelliJ IDEA. The error relates to the Apache Tomcat native library not being found. Here’s the debug output:
12:51:54.926 [restartedMain] DEBUG o.a.c.core.AprLifecycleListener - The Apache Tomcat Native library could not be found using names [tcnative-2, libtcnative-2, tcnative-1, libtcnative-1] on the java.library.path [C:Program FilesJavajdk-20bin;C:WindowsSunJavabin;C:Windowssystem32;C:.......
at org.apache.tomcat.jni.Library.<init>(Library.java:91)
at org.apache.tomcat.jni.Library.initialize(Library.java:147)
at org.apache.catalina.core.AprLifecycleListener.init(AprLifecycleListener.java:189)
at org.apache.catalina.core.AprLifecycleListener.isAprAvailable(AprLifecycleListener.java:106)
at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getDefaultServerLifecycleListeners(TomcatServletWebServerFactory.java:189)
This issue appeared out of nowhere:
I haven’t added any new dependencies.
I haven’t changed the package structure or settings.
My JAVA_HOME and system path variables point to a 64-bit version of Java, and my system is also 64-bit. I have never used a 32-bit version.
I understand from my research that this generally doesn’t affect the functionality of the program, but I’d like to resolve it if possible (other than pointing directly to the DLL libraries). I came across a similar issue on Stack Overflow (Apache Tomcat doesn’t find Native library) and tried the suggested solutions, including the one by “Asif Kamran Malick”, but nothing worked.
Can anyone explain what might have caused this error and how to fix it? Any insights would be greatly appreciated.
Thank you!
Romul Fobos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.