Add .dll to java.library.path in Eclipse/PyDev Jython project

后端 未结 3 1768
余生分开走
余生分开走 2020-12-29 05:33

I\'m trying to use a compiled .jar Java library in my PyDev Jython project.

I successfully added the .jar to the PYTHONPATH and was able to begin coding with auto co

相关标签:
3条回答
  • 2020-12-29 05:51

    I got this working.

    For future reference:

    Say the dll you need is in Y:\path\to\dlls\lib\. Then set your Run Configuration's working directory to Y:\path\to\dlls\ and set your VM arguments to include -Djava.library.path=lib.

    That's it, it should now work. I don't know why specifying an absolute path in java.library.path didn't work previously, but setting a working directory seems to have done it.

    Perhaps it's something peculiar to the specific library I'm using (or that Eclipse is running from a different drive than the library is on)...

    0 讨论(0)
  • 2020-12-29 05:55

    I had similar issue but with Ghost Script dll. Even when followed placing the files in working directory and followed the instructions, it didn't work for me, refer the tag Ghost4J. java.lang.UnsatisfiedLinkError: Unable to load library 'gsdll64' and used the -Djna.library.path to get it worked.

    0 讨论(0)
  • 2020-12-29 06:02

    I think the better way is:

    1. Create a folder under the project, for example dll.
    2. Copy/paste all dll files into this folder.
    3. In project -> Properties -> Java Build Path -> Source, click and expand the source details.
    4. You will see Native library location, click/highlight it.
    5. Then click edit on the right, click workspace again. You can see the dll folder under the project.
    6. Select it and click OK, OK. You will see the dll is added in the Native library location.

    That's it. You do not need to manually change anything in configuration.

    Java Build Path configuration

    0 讨论(0)
提交回复
热议问题