如何从任何位置调用/调用java代码中的sqljdbc_auth.dll [英] How to call/invoke sqljdbc_auth.dll in java code from any location

查看:72
本文介绍了如何从任何位置调用/调用java代码中的sqljdbc_auth.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意:我想从外部位置加载它的原因是我们无法访问c:并且在我的本地我已经将JRE文件夹复制到不同的位置并复制了.dll文件JRE / bin它对我来说很有用,但唯一的挑战是当我尝试从Jenkins运行它时它失败了它使用VM机器,所以我想在运行时调用代码本身的sqljdbc_auth.dll以便我将没有任何依赖的位置。





我尝试过:



i已经尝试过system.load()和system.loadlibrary()它不起作用

解决方案

无论哪种方式都需要dll在JVM的已知位置。指定绝对路径或使用如何加载Java(Windows)本机/动态库(DLL)中描述的选项之一)通过调用System.loadLibrary或System.load [ ^ ]

Note: the reason iI want to load it from external location is we do not have access to c: and in my local i have copied the JRE folder in different location and copied the .dll file in JRE/bin It is working from for me, but only challenge is when I try to run it from Jenkins it is failing it uses VM machine, so I thought of invoking the the sqljdbc_auth.dll in runtime in the code itself so that i will not have any dependency of the location.



What I have tried:

i have tried system.load() and system.loadlibrary() it does not work

解决方案

Either way the dll needs to be in a known location for the JVM. Specify the absolute path or use one of the options described in How to Load a Java (Windows) Native/Dynamic Library (DLL) by calling System.loadLibrary or System.load[^]


这篇关于如何从任何位置调用/调用java代码中的sqljdbc_auth.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆