Search code examples
pythonjavajaydebeapi

How to solve OSError: [WinError 126] JVM DLL not found when trying to use jaydebeapi in python 3.11 to make a database connection


I am trying to make a database connection using the Jaydebeapi package in Python3. My setup is running on a windows 2016 server. I have Java 8 and JDK installed. When I execute my script it returns the below error:

OSError: [WinError 126] JVM DLL not found: C:\Program Files\Java\jre1.8.0_60\bin\server\jvm.dll

When I run the script on my personal PC it works fine and I am using all the same software versions.

I can't find a solution anywhere else online.


Solution

  • SOLVED:

    I began to suspect that the version of Java that I installed required an internet connection so I downloaded a different version of java (jdk-8u341-windows-x64 offline) and installed that. After doing this I corrected the JAVA_HOME path and this ended up solving the problem.