java.lang.UnsatisfiedLinkError:java.library.path中没有sqljdbc_auth [英] java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path

查看:141
本文介绍了java.lang.UnsatisfiedLinkError:java.library.path中没有sqljdbc_auth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个java应用程序的.jar,当我尝试从cmd运行.jar时,我收到错误。

I'm created a .jar of my java application, and when i'm try to run that .jar from cmd, i get an error.

I我一直在寻找并找到了许多例子,但没有人为我工作。
我将java.library.path设置为目录'sqljdbc_auth.dll',就像我在这里看到的那样,但错误是连续的。

I've been searching and found many examples, but no one work's for me. I set the java.library.path to the directory ‘sqljdbc_auth.dll’ like I saw here but the error continuous.

http://www.linglom.com/images/howto/netbeans/sqlserver/part3/8 .png

我用命令运行我的java应用程序:java -Djava.library.path =my dll path并给出:

I Run my java application with command : java -Djava.library.path= "my dll path" and give this:

PS C:\Users\User> java -Djava.library.path="C:\Users\User\Desktop\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc
_4.0\ptb\auth\x64"
Error: Could not find or load main class .library.path=C:\Users\User\Desktop\Microsoft JDBC Driver 4.0 for SQL Server
\sqljdbc_4.0\ptb\auth\x64

我真的不知道如何解决这个问题。
我一直在寻找很多时间,但没有任何作用。请有人帮助我。

I really dont no how solve this. I've been searching a lot of time, but nothing works. Please someone help me.

谢谢

 WARNING: Failed to load the sqljdbc_auth.dll cause : no sqljdbc_auth in java.library.path
com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrat
ectionId:0481a2ee-4ac4-4fd3-89cd-58aad1696fe4
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.j
        at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<init>(AuthenticationJNI.java:60)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.
        at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServe
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnect
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnecti
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.jav
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at test.database.Conection.getConexao(Conection.java:41)
        at test.forms.jTLogin.<init>(jTLogin.java:71)
        at test.forms.jTLogin$4.run(jTLogin.java:448)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.loadLibrary0(Unknown Source)
        at java.lang.System.loadLibrary(Unknown Source)
        at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(AuthenticationJNI.java:3
        ... 28 more


推荐答案

搞定了......

1)在Java中添加.dll和.jar / JDK / bin

1) Added .dll and .jar in Java/JDK/bin

2)在applications / lib中添加.jar

2) Added .jar in applications/lib

3)在Windows中添加.dll / system32

3) Added .dll in windows/system32

在Path系统环境中添加java / jdk ../ bin和windows / system32。

add the java/jdk../bin and windows/system32 in "Path" system environment.

这篇关于java.lang.UnsatisfiedLinkError:java.library.path中没有sqljdbc_auth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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