eclipse Java:如何解决 java.lang.UnsatisfiedLinkError:java.library.path 中没有 J3D

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7966067/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:16:32  来源:igfitidea点击:

Java : howto resolve java.lang.UnsatisfiedLinkError: no J3D in java.library.path

javaeclipsenativejava-3d

提问by Pawan

when i tried to run a Java 3d PROGRAM , it gave me the following error .

当我尝试运行 Java 3d 程序时,它给了我以下错误。

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)

I followed this web site to solve this error

我跟着这个网站来解决这个错误

http://www.filsa.net/2008/07/17/eclipse-java3d-and-javalibrarypath/

It says that , after adding the jar files Additionally, you need to put the native code, j3dcore-ogl.dll (j3dcore-ogl.so on Linux) onto the PATH.

它说,在添加 jar 文件之后,您还需要将本机代码 j3dcore-ogl.dll(Linux 上的 j3dcore-ogl.so)放到 PATH 中。

I have got these dll files under the j3d-1_5_2-windows-i586\bin\j3dcore-ogl.dll folder

我在 j3d-1_5_2-windows-i586\bin\j3dcore-ogl.dll 文件夹下有这些 dll 文件

I added this support from Eclipse this way Java Build Path --->Add Exernal Class Folder -->and upto bin path (Exactly there at which these dll files are residing )

我以这种方式从 Eclipse 添加了此支持 Java Build Path --->Add Exernal Class Folder --> and upto bin path (正是这些 dll 文件所在的位置)

After doing this step also , i am getting the same exception . This is how my Eclipse IDE build path looks now enter image description here

也做了这一步后,我得到了同样的例外。这就是我的 Eclipse IDE 构建路径现在的样子 在此处输入图片说明

Thank you very much .

非常感谢 。

回答by Antoine

I solved the question, very easy:

Just copy & paste & merge the j3d library's bin/ & lib/folders into the corresponding bin/ & lib/folders of both the jre/ & jdk/JVM folders that you use.

我解决了这个问题,非常简单:

只需将 j3d 库的bin/ & lib/文件夹复制粘贴并合并到您使用bin/ & lib/的两个jre/ & jdk/JVM 文件夹的相应文件夹中即可。

  1. Download corresponding j3d Zip binaries at https://java3d.java.net/binary-builds.html. For me, a win7 64bit Java VM (aka. jdk & jre), I choose j3d-1_5_2-windows-amd64.zip.
  2. UnZip the downloaded j3d Zip binaries (j3d-1_5_2-windows-amd64.zip) to get the j3d-jre.zipfile inside.
  3. UnZip the j3d-jre.zipto get the bin/ & lib/folders.
  4. Copy & paste & merge the obtained bin/ & lib/folders into the corresponding bin/ & lib/folders of my JVM folders (aka. both jdk/ & jre/folders).
  1. 在 https://java3d.java.net/binary-builds.html 下载相应的 j3d Zip 二进制文件。对我来说,一个 win7 64 位 Java VM(又名。jdk 和 jre),我选择j3d-1_5_2-windows-amd64.zip.
  2. 解压缩下载的 j3d Zip 二进制文件 ( j3d-1_5_2-windows-amd64.zip) 以获取其中的j3d-jre.zip文件。
  3. 解压缩j3d-jre.zip以获取bin/ & lib/文件夹。
  4. 将获得的bin/ & lib/文件夹复制并粘贴并合并到bin/ & lib/我的 JVM 文件夹(也称为两个jdk/ & jre/文件夹)的相应文件夹中。



For other JVMs, it's the same thing - copy & paste & merge the j3d zip library's bin/ & lib/folders into the corresponding bin/ & lib/folders of the JVM's jre/ & jdk/



对于其他 JVM,这是相同的事情 - 将 j3d zip 库的bin/ & lib/文件夹复制粘贴并合并到bin/ & lib/JVM 的相应文件夹中jre/ & jdk/

回答by Pavan

Can you try executing regsvr32 "name_of_dll-file" from the run menu? You need to reboot the machine for this to take effect.

您可以尝试从运行菜单中执行 regsvr32 "name_of_dll-file" 吗?您需要重新启动机器才能使其生效。

This adds the DLL as a library that other programs can access. Adding it to the Eclipse build path is not the right thing since that will only be accessible to your JVM.

这会将 DLL 添加为其他程序可以访问的库。将它添加到 Eclipse 构建路径并不是正确的事情,因为它只能被您的 JVM 访问。

回答by uzx 619

Copy .dll file to Windows/system32 folder, then press (Windows + R) to start (Run)

将 .dll 文件复制到 Windows/system32 文件夹,然后按 (Windows + R) 启动 (Run)

in the field, type regsvr32 "dll_name"

在字段中,键入 regsvr32 "dll_name"

"dll_name" is the name of the file in bin folder of the library.

“dll_name”是库的 bin 文件夹中的文件名。

回答by kiryo

i solved problem by copying j3dcore-ogl.dll to windows/system32 folder

我通过将 j3dcore-ogl.dll 复制到 windows/system32 文件夹解决了问题