简体   繁体   中英

Create runnable jar file in Eclipse

  • I use sqljdbc driver for my project
  • I have a "libs" folder to store all libraries
  • To be able to connect to MSSQLServer I set "Native Library Location" for my sqljdbc4.jar. You see this native library location is in "libs" folder too

在此处输入图片说明

  • Everything's OK,but when I create runnable jar file, I have connection problem

      org.hibernate.exception.JDBCConnectionException: Could not open connection 
  • It is caused by "no sqljdbc_auth in java.library.path"

What should I do to create a right runnable jar file? Thanks in advance!

You might need to add your sqljdbc driver to your Classpath Variables as follows:

Window -> Preferences -> Java -> Build Path -> Classpath Variables

With the 'New' button you can add the name and the path to your file.

Hope this helps !

OK I found it. Add sqljdbc_auth.dll of driver to System32, and no need to add native library location anymore

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM