简体   繁体   English

Java NetBeans-将我的.DLL存储在PATH中,它在哪里?

[英]Java NetBeans - storing my .DLL in PATH - where is it?

This is probably trivial - I almost feel embarrassed to ask, but I am new to this. 这可能是微不足道的-我几乎不敢问这个问题,但是我对此并不陌生。

So I downloaded a library that uses JNI and I need to store the .dll library in my PATH. 因此,我下载了使用JNI的库,并且需要将.dll库存储在PATH中。 What is my PATH and where can I find it? 我的路径是什么?在哪里可以找到它?

I assume you are talking about Windows. 我认为您正在谈论Windows。 To set system wide PATH you should right click on "My computer" go to Advanced, click "Environment Variables" and there you should find the PATH variable, which you can modify (in System variables). 要设置系统范围的PATH,您应该右键单击“我的电脑”,转到“高级”,单击“环境变量”,然后您将在其中找到可以修改的PATH变量(在系统变量中)。

Edit: for Linux loading a .so (dynamic link library for linux) is done using LD_LIBRARY_PATH environment variable which has to contain the directory of the .so. 编辑:对于Linux,使用LD_LIBRARY_PATH环境变量完成.so(Linux的动态链接库)的加载,该环境变量必须包含.so的目录。

So you can have a script running your program that does (just an example): 因此,您可以运行一个脚本来运行程序(仅作为示例):

#!/bin/bash
export LD_LIBRARY_PATH=/install_directory
java -jar /install_directory/myjar.jar 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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