使用库将项目导出到可运行于Eclipse的jar [英] Exporting project with libraries to runnable jar from Eclipse

查看:294
本文介绍了使用库将项目导出到可运行于Eclipse的jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图出口一个我正在开发的游戏(使用Slick库)的测试,发送给我的缺乏任何IDE的合作伙伴,所有这些都与eclipse中的出口一致,但是当我尝试运行它从命令提示符,这是我得到的回报。

I was trying to export a test of a game I am working on(that uses the Slick library), to send to my partners who lack any IDE, all went well with the export in eclipse, but when I try to run it from command prompt, this is what I get in return.

C:\Users\Noah\Desktop>java -jar test.jar
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
der.java:58)
Caused by: java.lang.UnsatisfiedLinkError: no lwjgl 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 org.lwjgl.Sys$1.run(Sys.java:73)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
        at org.lwjgl.Sys.loadLibrary(Sys.java:95)
        at org.lwjgl.Sys.<clinit>(Sys.java:112)
        at org.lwjgl.opengl.Display.<clinit>(Display.java:141)
        at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:36)

        at org.nor.Main.main(Main.java:16)
        ... 5 more

C:\Users\Noah\Desktop>

任何想法出了什么问题?

Any idea what is going wrong?

注意:该项目在eclipse中运行得很好。

NOTE: The project runs perfectly fine in eclipse.

推荐答案

你应该阅读get started指南,你将要使用它Slick有几个依赖使用dll与opengl通信。您需要指定这些dll的保留位置,以便这些依赖关系可以加载dll。我发现这个链接可能有助于您做到这一点..

You should read up on a "get started" guide on slick if you are going to use it. Slick has several dependencies who use dll's to communicate with opengl. You need to specify where those dll's are kept so these dependencies can load the dll's. I found this link that might help you do that..

这篇关于使用库将项目导出到可运行于Eclipse的jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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