JOGL库无法加载库,但它们位于引用的库文件夹中 [英] JOGL libraries can't load libraries but they're in the referenced libraries folder

查看:89
本文介绍了JOGL库无法加载库,但它们位于引用的库文件夹中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我尝试在eclipse中学习JOGL,但是每次运行代码时,都会出现错误,指出它们找不到所引用的库,但是我知道它们已被引用,因为eclipse在生成的文件夹"Referenced"中列出了它们库",它们是intel,我的机器是intel.

So I'm trying to learn JOGL in eclipse however every time I run my code I get errors indicated they can't find the referenced libraries, however I know they are referenced because eclipse has them listed in the generated folder "Referenced Libraries" and they are intel and my machine is intel.

该代码不会生成任何错误标签,但是在我尝试运行它时会发出系统错误.我收到以下错误

The code generates no error tags but sends out system errors when I try to run it. I get the following errors

Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: 

C:\Users\Cody\new\workspace\render\gluegen-rt.dll

    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.load0(Unknown Source)
    at java.lang.System.load(Unknown Source)
    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:596)

    at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:64)

    at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:96)

    at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:459)

    at com.jogamp.common.os.DynamicLibraryBundle$GlueJNILibLoader.loadLibrary(DynamicLibraryBundle.java:388)

    at com.jogamp.common.os.Platform$1.run(Platform.java:209)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.jogamp.common.os.Platform.<clinit>(Platform.java:179)
    at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:120)
    at hellowordjogl.render.main(render.java:59)

我的代码如下

package hellowordjogl;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.media.opengl.GL2;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.GLU;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.Renderer;

import com.jogamp.graph.curve.opengl.RenderState;
import com.jogamp.opengl.util.FPSAnimator;

 public class render implements GLEventListener{

    @Override
    public void display(GLAutoDrawable arg0) {
        // TODO Auto-generated method stub      
    }

    @Override
    public void dispose(GLAutoDrawable arg0) {
        // TODO Auto-generated method stub      
    }

    @Override
    public void init(GLAutoDrawable arg0) {
        // TODO Auto-generated method stub      
    }

    @Override
    public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3,
            int arg4) {
        // TODO Auto-generated method stub      
    }           

    public static void main(String[] args) {
        //
        final GLProfile profile = GLProfile.get(GLProfile.GL2);
        GLCapabilities capabilities = new GLCapabilities(profile);

        // canvas

        final GLCanvas glcanvas = new GLCanvas(capabilities);
        render r = new render();
        glcanvas.addGLEventListener(r);
        final FPSAnimator animator = new FPSAnimator(glcanvas, 300,true);
        // pass in glcanvas to jframe
        final JFrame frame = new JFrame ("test 1");
        frame.getContentPane().add(glcanvas);       

        //shutdown process

        frame.addWindowListener(new WindowAdapter(){
            public void windowClosing(WindowEvent e){
                if(animator.isStarted())
                    animator.stop();
                System.exit(0);
            }

        });

        // center screen and make it visible

        frame.setLocationRelativeTo(null);
        frame.setVisible(true);     
    }       
    }

还有哪些可能发送这些错误? eclipse真的没有引用这个吗?我已经通过包括Java构建路径在内的几种方式完成了此操作.我也在这里完成了此解决方案,并且收到了相同的错误

What else could be sending these errors? Is eclipse really not referencing this? I've done it a few ways including java build path. I have also done this solution here and I receive the same errors

JOGL例外-找不到胶粘剂- rt in java.library.path

我也进入了配置构建路径,然后进入了库,并将它们添加到它们中,既在其中包含文件的now文件夹中,又将它们放入其中.

I have gone also into configuration build path then to libraries and added them in their, both in a now folder with files in them and then having just put them their.

有些建议/帮助会受到赞赏,因为我在这里很茫然.

Some advice/help is appreciated as I'm at a loss here.

推荐答案

请遵循这些详细信息Eclipse的说明.

包含本机库的JAR必须与包含Java库的JAR位于同一目录中.例如,glugengen-rt.jar和glugengen-rt-natives-*.jar必须位于同一目录中.

The JARs containing the native libraries must be in the same directory than the JARs containing the Java libraries. For example, gluegen-rt.jar and gluegen-rt-natives-*.jar must be in the same directory.

这篇关于JOGL库无法加载库,但它们位于引用的库文件夹中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆