sqljdbc_auth.dll not found in java.libray.path in a gradle task trying to make a connection to a db.
I'm new to gradle so pardon my ignorance on this post :)
In IntelliJ we start up a service and run some gradle before lauchto populate a db and other stuff.
In the gradle we make a call to DriverManager.getConnection(databaseUrl). The Url is jdbc:sqlserver... The gradle task is a type:JavaExec so from what I understand IntelliJ will spin up a JVM to execute the getConnection but the "java.libray.path" which is set correctly in gradle does not get passed into the JVM and I get this error: "no sqljdbc_auth in java.libray.path". The dll is in the path but the property is not making into the JVM that gets spun up. I copied the dll to c:\Windows\System32 and that works fine but not the solution I want for our developers. I tried setting the java.libray.path in VM options for the server and the VM options for the gradle task and the script parameters and such. Nothing seems to work. I googled around and saw a lot similar problems with solutions. Some had a line that copied system.properties to systemProperties but that line wouldn't run in gradle. None of the other ideas worked either.
Any help is much appreciated.
Please sign in to leave a comment.
Do you mean that the issue occurs only when running from IntelliJ IDEA and the same task works fine in the command line (cmd.exe) gradle build?
I initially thought so until I ran the gradle from the command line this morning with the new path (calling the getConnection) and it fails the same way. Must be an issue outside of IntelliJ :/
Try asking at Gradle forums or at http://stackoverflow.com/. Sharing a reproducible test case would help to get the solution faster.