Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  LWJGL app cross-platform testing.  (Read 4241 times)
0 Members and 1 Guest are viewing this topic.
Offline Morgan Allen
« Posted 2011-06-18 21:37:53 »

I wasn't entirely certain where to post this topic, but the problem I've been having with some of my 3D apps is very inconsistent performance on different platforms- e.g, running indordinately slower on Windows/not at all on Linux.

So, what I have here is a (relatively) simple LWJGL application that creates and renders a small planet using a modified form of fractal terrain generation.  EDIT:  Have replaced eclipse project with kappa's spliced jarfile.

This should be a representative screenshot-



http://www.filedropper.com/flatearth_1

Could a couple of folks running Windows/Linux download the .jar, and see if it runs smoothly?  Thanks in advance.
Offline ra4king

JGO Kernel


Medals: 353
Projects: 3
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2011-06-18 23:00:47 »

To export a project as a Jar file in Eclipse, you right click the project name, click "Export", under Java choose "Jar file", and then choose your settings.

And there is supposed to be a semicolon between the period and lwjgl.jar Wink

Well it runs very smoothly on my computer: Windows 7 x64, crappy Intel integrated GMA.

Offline Morgan Allen
« Reply #2 - Posted 2011-06-19 17:30:40 »

That's good to hear. Smiley  I'll try exporting as .jar file, but has anyone else had luck in the meantime?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #3 - Posted 2011-06-19 17:46:46 »

I haven't really put together a double-clickable application- and would appreciate any tips on that, actually.

I'd recommend you try the JarSplice tool, it'll create  a single executable jar for you (which includes all your jars and native files). This'll create a jar that works on Windows, Mac and Linux just by double clicking (so no need to mess with the command line).
Offline Morgan Allen
« Reply #4 - Posted 2011-06-20 17:34:21 »

No joy, I'm afraid.  Exporting as a .jar using eclipse gives the following:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

And the .jar I get using JarSplice spits out a 'jar file is invalid or corrupt' error.  Did you have any luck with that yourself?
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #5 - Posted 2011-06-20 18:51:35 »

No joy, I'm afraid.  Exporting as a .jar using eclipse gives the following:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path

And the .jar I get using JarSplice spits out a 'jar file is invalid or corrupt' error.  Did you have any luck with that yourself?

Yeh, works fine for me, had a quick go at putting your project through it, produced this. Which works fine here.

You probably missed a step or something.
Offline Morgan Allen
« Reply #6 - Posted 2011-06-21 12:44:19 »

Yeh, works fine for me, had a quick go at putting your project through it, produced this. Which works fine here.

You probably missed a step or something.
Yeah, most likely- that .jar you whipped up works fine for me, so thanks for that.  What's the procedure?  Make a jar out of everything except lwjgl.jar+natives first?  Glad it works smoothly outside the Mac, anyways.
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #7 - Posted 2011-06-21 13:13:19 »

Yeah, most likely- that .jar you whipped up works fine for me, so thanks for that.  What's the procedure?  Make a jar out of everything except lwjgl.jar+natives first?  Glad it works smoothly outside the Mac, anyways.

Not difficult to create a executable jar for the above project.

1) Add all your project jars - since you only use lwjgl.jar and your own classes that all you need to add there. Your src folder wasn't in a jar/zip so just put it in one and added it to the list.

2) Add all the natives your project uses - added all the LWJGL *.dll (windows), *.so (linux) and *.dylib,*.jnilib (mac) natives files to the natives tab.

3) Add the main class: src.main.Loop

Thats it, click create jar.
Offline Morgan Allen
« Reply #8 - Posted 2011-06-21 14:02:01 »

I *think* I followed those steps like you said, but for some reason, when I unpack the jar, the native libraries aren't included.

Would I be able to recreate this process from the command line?
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #9 - Posted 2011-06-21 14:49:25 »

I *think* I followed those steps like you said, but for some reason, when I unpack the jar, the native libraries aren't included.

Would I be able to recreate this process from the command line?

not at the moment, you can try run the tool via the command line to see if any exceptions are thrown.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Morgan Allen
« Reply #10 - Posted 2011-06-21 18:04:35 »

Not at the moment, you can try run the tool via the command line to see if any exceptions are thrown.
That's where I got the 'jarfile is invalid or corrupt' message from.  I'm going to see if can just keep the manifest file and the org.ninjacave.jarsplice.core.JarSpliceLauncher.class file, then add in the native libs manually...
Offline Morgan Allen
« Reply #11 - Posted 2011-06-22 04:26:18 »

Wait!  It's working perfectly now.  I think the problem was that I was adding .jars other than the main source and lwjgl.jar (i.e, lwjgl-debug, etc.)  Thanks a bunch!

(BTW, there's a slight bug with parent folders not being displayed when you want to save the final spliced .jar to a different folder-

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at com.apple.laf.AquaMenuPainter.paintSelectedMenuItemBackground(AquaMenuPainter.java:148)
   at com.apple.laf.AquaComboBoxRendererInternal.paintComponent(AquaComboBoxRenderer.java:125)

)
Quote
Not at the moment, you can try run the tool via the command line to see if any exceptions are thrown.
Also- I misunderstood you here.  I thought you meant running the final .jar from the command line.  Anyway, my mistake...
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #12 - Posted 2011-06-22 08:24:21 »

Wait!  It's working perfectly now.  I think the problem was that I was adding .jars other than the main source and lwjgl.jar (i.e, lwjgl-debug, etc.)  Thanks a bunch!
Ah right that explains it, since lwjgl-debug.jar has identical named classes to lwjgl.jar. Will put a warning (better error message) in future versions.

(BTW, there's a slight bug with parent folders not being displayed when you want to save the final spliced .jar to a different folder-

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at com.apple.laf.AquaMenuPainter.paintSelectedMenuItemBackground(AquaMenuPainter.java:148)
   at com.apple.laf.AquaComboBoxRendererInternal.paintComponent(AquaComboBoxRenderer.java:125)

)
yeh, this is a Mac OS X java bug with the Ocean theme, I'll see if I can change the LAF to one that works.

thanks
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (33 views)
2014-10-27 03:28:38

TehJavaDev (27 views)
2014-10-27 03:27:51

DarkCart (41 views)
2014-10-26 19:37:11

Luminem (22 views)
2014-10-26 10:17:50

Luminem (27 views)
2014-10-26 10:14:04

theagentd (33 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (59 views)
2014-10-16 15:22:06

Norakomi (48 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!