0

my friend's and I wrote a game in Java using LWJGL and Slick-Util.

In the main function, the first line I have is

    System.setProperty("org.lwjgl.librarypath", System.getProperty("user.dir") + "/natives/");

to set the path to the natives.

The game works fine in eclipse, the resources folder was copied exactly to the location of the exported jar, the libraries are definitely where they need to be: for some reason, on startup java reports a crash TWICE, and no error log is printed to the console (when run from command line). Is this something that may root from a common problem? Is there good way to make error reporting more verbose? Any help would be greatly appreciated. Also, strangely enough, the native libraries were no longer linked in eclipse, yet it still runs in eclipse.

4

1 回答 1

0

只需将jar中使用的dll复制到jar所在的文件夹中即可。(只需将它们放在jar文件附近)

为我的 jmonkey-jocl 基准测试工作http://forums.guru3d.com/showthread.php?t=379276

您可能需要一个额外的 .bat 文件来启动具有更多 RAM 资源的 jvm。

在bat文件中:

 java -mx2048M -XX:MaxGCPauseMillis=1 -XX:GCPauseIntervalMillis=60000 -XX:ConcGCThreads=2 -XX:ParallelGCThreads=2 -jar physics.jar

为 jvm 腾出 2GB 空间,自定义垃圾收集方式,运行physics.jar

 %~p0physics.jar %*  rather than just physics.jar

使寻址更加灵活。

于 2013-06-11T23:33:00.153 回答