我安装了 JOGL,但为什么 Eclipse 无法识别我的 hello world 程序?
我安装了 Jogl 并将其包含在 Eclipse 的构建路径中,但它位于引用的库下。这是程序。
public class exceptionhandler
{ // open HelloWorld
public static void main(String[] args)
{ // open main
try
{ // open try
System.loadLibrary("jogl");
System.out.println("Hello World! (The native libraries are installed.)");
} // close try
catch (Exception e) // all try's need a catch
{ } // even if the catch does nothing
} // close main
} // close HelloWorld
我没有包含导入,因为 Eclipse 无法识别它。所以当我运行它时,我得到这个>
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at exceptionhandler.main(exceptionhandler.java:8)
i installed Jogl and included it in the build path of eclipse but it is under referenced libraries. Here is the program.
public class exceptionhandler
{ // open HelloWorld
public static void main(String[] args)
{ // open main
try
{ // open try
System.loadLibrary("jogl");
System.out.println("Hello World! (The native libraries are installed.)");
} // close try
catch (Exception e) // all try's need a catch
{ } // even if the catch does nothing
} // close main
} // close HelloWorld
I did not include the import because Eclipse didn't recognize it. So when i do run it i get this>
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at exceptionhandler.main(exceptionhandler.java:8)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确定您使用的是最新版本的 JOGL 吗?您是否也下载了包含本机库的 JAR?您是否将它们放入与 jogl-all.jar 和gluegen-rt.jar 相同的目录中?
Are you sure you use the latest version of JOGL? Have you downloaded the JARs containing the native libraries too? Have you put them into the same directory than jogl-all.jar and gluegen-rt.jar?
您是否在 Eclipse 构建路径设置中指定了 jogl.dll 的路径?
有关说明,请参阅 https://stackoverflow.com/a/958074/1216956。
Have you specified the path to jogl.dll in the Eclipse build-path settings?
See https://stackoverflow.com/a/958074/1216956 for instructions.