Results 1 to 7 of 7
  1. #1
    major is offline Member
    Join Date
    Jun 2011
    Posts
    12
    Rep Power
    0

    Default specify native library in java command line

    My application is :
    1. packed into 1 jar file
    2. use sqljdbc4.jar
    2. use a native library: "Microsoft SQL Server JDBC Driver 3.0".(use it in Ecplise and it works fine)
    3. run by this command: "java -jar myapp.jar".

    btw: I config all the class paths in the manifest.mf file

    My application is failed to run, since it cannot find the native library. How/where to specify the native library location?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    That's not a native library is it?
    It's the JDBC jar for SQL Server.
    What errors are you getting?

  3. #3
    major is offline Member
    Join Date
    Jun 2011
    Posts
    12
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    That's not a native library is it?
    It's the JDBC jar for SQL Server.
    What errors are you getting?

    Yes indeed, this is the JDBC driver, but since I use "integratedSecurity=true;" in the connection string, it's required to add the project the native library location which locates here "sqljdbc_3.0\enu\auth\x86" in the JDBC directory.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    So there's a DLL in that location?

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,894
    Rep Power
    25

  6. #6
    major is offline Member
    Join Date
    Jun 2011
    Posts
    12
    Rep Power
    0

    Default

    1. enter the absolute path to native library with no spaces to system PATH
    2.run like this:
    java -Djava.library.path=absolute path to native library with no spaces -jar myapp.jar

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

Similar Threads

  1. NetBeans - Path to Native Library?
    By RichWade in forum NetBeans
    Replies: 8
    Last Post: 11-22-2010, 08:12 PM
  2. Replies: 2
    Last Post: 07-02-2010, 03:20 PM
  3. I want to put the native library in library path in mac os x
    By Hussain Ali in forum Advanced Java
    Replies: 2
    Last Post: 02-24-2010, 08:55 AM
  4. Loading a library (for native methods)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-23-2007, 08:45 AM
  5. Unable to execute command line command in java
    By LordSM in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 01:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •