Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  sigh  (Read 5547 times)
0 Members and 1 Guest are viewing this topic.
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Posted 2003-05-13 20:50:12 »

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path


What the f**k is that.

Seriously.

I have lwjgl.jar added to the classpath. What does it want from me? Can a jigga get a install.txt? :/
Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2003-05-13 21:32:37 »

That's the DLL it's looking for.

Add -Djava.library.path=<directory where the lwjgl.dll is> to your commandline. Or simply ensure that the lwjgl.dll is in the current working directory when you fire up a jar, say. Don't forget to put OpenAL32.dll in there as well if you're doing sound.

Cas Smiley

Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #2 - Posted 2003-05-13 22:30:32 »

I couldn't get the command line to work in eclipse for whatever reason ( Edit: yay i got it working in eclipse ) so I just put the .dlls in the dir.

Now I get -

java.lang.Exception: The keyboard could not be created.
     at org.lwjgl.input.Keyboard.create(Unknown Source)
     at Test2D.init(Test2D.java:116)
     at Test2D.main(Test2D.java:70)
No window

- with my code. Least were moving forward here. Tongue

Thanks cas.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #3 - Posted 2003-05-14 03:06:17 »

Quote
java.lang.Exception: The keyboard could not be created.
     at org.lwjgl.input.Keyboard.create(Unknown Source)
     at Test2D.init(Test2D.java:116)
     at Test2D.main(Test2D.java:70)
No window

Well that is actually a good exception message Smiley - the error:
No Window

You need to create a GL instance (which inherits from Window) BEFORE creating the Keyboard.

Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #4 - Posted 2003-05-14 03:46:43 »

My GL creation isn't throwing any exceptions and it's being created before the keyboard. My code is like a copy of what's up on the LWJGL page modified for .6.

Do you see anything wrong with this line?

gl = new GL( "Test2D", 0, 0, 640, 480, 16, 0, 0, 0 );
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #5 - Posted 2003-05-14 03:54:24 »

are you calling gl.create() too?

Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #6 - Posted 2003-05-14 04:37:31 »

Oh crap. Tongue Well, problem is, I read a post explaining the changes (i think it was acually from you) and I for whatever reason just assumed that was a complete change and it was the ONLY thing I had to do. My bad.

You guys really need to update your page. <g>

Edit: Sonofabitch. Now it works. Tongue Thanks.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #7 - Posted 2003-05-14 05:12:01 »

Quote
You guys really need to update your page. <g>

Indeed, but Real Life is intefering sometimes  :-/

One of my main goals for 0.7, is a general cleanup in the API and documentation (or lack thereof)

Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #8 - Posted 2003-05-14 06:52:54 »

No plan survives first contact with Real Life (tm).

Tongue
Offline psiegel

Junior Member




Adamant about gaming.


« Reply #9 - Posted 2003-05-14 11:29:56 »

Just thought I would note that you can also drop the dlls into <path to jdk>\jre\bin or your windows system directory and any code you write will be able to find it.  This allows you to skip the -Djava.library.path and/or copying the dlls from one project to the next.

Of course, you'll still have to be aware of what to do with the dlls when you redistribute, in which case simply keeping them in the same directory as the jar file is probably preferable to dropping them into a system directory.

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 386
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2003-05-14 12:42:30 »

I strongly advise not doing this though, as you'll be in for a world of pain and incompatibility. Just plonk the dlls in the same place as your current project and use the -D. It'll save you grief later, when we break the API Smiley

Cas Smiley

Offline psiegel

Junior Member




Adamant about gaming.


« Reply #11 - Posted 2003-05-14 13:26:13 »

We're already in a world of pain and incompatibility when you break the API.  What's one more step of copying the dlls?  Wink

I guess I don't mind replacing the entire lib system wide like this since it's exactly what I have to do in Linux anyway.  There's no "just drop the .so into the same directory as the jar" there yet.  (And I strongly hope the emphasis there is on the yet.)

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #12 - Posted 2003-05-14 14:05:24 »

Should I be able to export my project to a jar in eclipse, copy lwjgl.dll to the dir where the jar is, and then be able to just double click the jar?

Double clicking it seems to have no effect right now.
Offline psiegel

Junior Member




Adamant about gaming.


« Reply #13 - Posted 2003-05-14 15:28:37 »

In order to have a jar file do something when you double-click it, you have to set the "Main-class" property in the manifest.   Now, I'm not sure how eclipse builds jar files, I usually do mine by hand or use Ant.  Anyway, here's a little reference on what I'm talking about:

http://java.sun.com/docs/books/tutorial/jar/basics/run.html

Look towards the bottom for the section labeled "Jar files as applications".

-Paul

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #14 - Posted 2003-05-14 15:33:26 »

Main class is set. It's in the last dialog of eclipse's export thingy. That's why I'm a bit confused that I'm getting *nothing*. I tried it 2 times making SURE that was set.

Edit: Lemme just say that I have exported to jar files before and everything worked great, but the only difference I see here is the lwjgl stuff.

But I'm an idiot so who knows. Tongue
Offline psiegel

Junior Member




Adamant about gaming.


« Reply #15 - Posted 2003-05-14 15:50:25 »

Unfortunately double-clicking the jar file doesn't give any output when something goes wrong.  Try opening a dos prompt to the directory and using the command:

java -jar myjarfile.jar

This is pretty much the same as double-clicking, but hopefully any errors will spew out onto the screen instead of being hidden.

Paul Siegel
Adamant Games, Inc.
http://www.adamantgames.com
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #16 - Posted 2003-05-14 16:31:55 »

bedelf:

Just for clarification, are you trying to double click the lwjgl.jar or a jar with your code that you generated?

Don't send a man to do a monkey's work.
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #17 - Posted 2003-05-14 16:34:17 »

Oh, duh.

C:\Test2D>java -jar Test2d.jar
java.lang.NoClassDefFoundError: org/lwjgl/opengl/GL
       at Test2D.init(Test2D.java:103)
       at Test2D.main(Test2D.java:37)
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/input/Keybo
ard
       at Test2D.cleanup(Test2D.java:124)
       at Test2D.main(Test2D.java:49)

Now the question is, what's the best way to solve that.

Edit: acually lemme rephrash, I guess my question is, if I was gonna send my jar to someone else, whats the easiest way for them to get this working.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #18 - Posted 2003-05-14 16:51:38 »

Two options:

1. Plop lwjgl.jar into <java home>/lib/ext where <java home> is the JRE directory. (i.e. c:\Program Files\Java\1.4\lib\ext or c:\j2sdk1.4\jre\lib\ext)

2. Use the snazzy manifest features! Simply create a Manifest like this:

1  
2  
Main-Class: com.whatever.MyClass
Class-Path: lib/lwjgl.jar lib/timer.jar


Then package your Jar with "jar -cvmf mymanifest.mf myjar.jar com/whatever/*.class"

For distribution, you should create a zip file with a packing list simialr to this:


myjar.jar
lwjgl.jar
lwjgl.dll
openal.dll


That way when they unzip it, they can simply double click on myjar.jar. The Shooter example over on the GAGE homepage uses this. You could even pack your program into an NSIS installer and have it automatically generate start menu icons to your JAR file. Just make sure you set the working directory right or it won't be able to find lwjgl.jar.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #19 - Posted 2003-05-14 19:15:05 »

I'm not having any luck so far, I keep getting

Failed to load Main-Class manifest attribute from
Test2D.jar

But it's in there, tried it 100 ways. I'm looking at the Manifest docs but it's not telling me anything I don't already know.

Has anyone done this from eclipse?
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #20 - Posted 2003-05-14 19:17:50 »

Can you post your Manifest?

Java Game Console Project
Last Journal Entry: 12/17/04
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #21 - Posted 2003-05-14 19:47:56 »

Looks something like this right now, note that main is located in Test2D.java

Manifest-Version: 1.0
Class-Path: ..lwjgl.jar
Main-Class: Test2D
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #22 - Posted 2003-05-14 19:54:21 »


Manifest-Version: 1.0
Class-Path: ..lwjgl.jar
Main-Class: Test2D


Hmm... messy. Are you trying to get the lwjgl in the current directory or the parent directory? If it's the later, you need "../lwjgl.jar" otherwise "lwjgl.jar" will work fine. Try this:


Main-Class: Test2D
Class-Path: lwjgl.jar


Remember to have an extra blank line at the end of the manifest file and no extra spaces in front of the manifest entries.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #23 - Posted 2003-05-14 20:02:19 »

..already tried that, it looks like that because i was copying someone elses to see if it worked.

I tried it again just for fun and it still didnt work.

Edit: all the files are in the same directory

Edit: do you use eclipse jbanes?
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #24 - Posted 2003-05-14 20:23:34 »

Tell you what, generate a JAR using the manifest I gave you, then email the JAR to jbanes@techie.com. I'll take a look at it and see what I find.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #25 - Posted 2003-05-14 20:38:08 »

This is really sad, I know it's something freaking STUPID too. I could prolly figure this out if I wasn't being pulled in 8 different directions in rl atm.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #26 - Posted 2003-05-14 22:13:41 »

Sorry if I break out laughing at some point, but I think you need to stop using Eclipse to make JAR files. I got the file through email and proceded to attempt running it. As expected, it didn't run. So I'm thinking "I'll check out what's in the manifest". I do "jar -xvf Test2D.jar META-INF" and open the META-INF/MANIFEST.MF. Man was I in for a shock. It was blank! I do a double take and then type "jar -tvf Test2D.jar". This is what I see:


    2 Wed May 14 15:28:58 CDT 2003 META-INF/MANIFEST.MF
  311 Tue May 13 14:09:02 CDT 2003 .classpath
  382 Tue May 13 14:07:50 CDT 2003 .project
   43 Wed May 14 15:28:50 CDT 2003 Manifest.mf
 4487 Wed May 14 10:08:58 CDT 2003 Test2D.class
34169 Sat Nov 18 05:55:34 CST 2000 nehe.png


Hmm... That's not right. The manifest was included as a normal file. Here's what you need to do to make this work:

1. Open a command line window
2. Go to the directory with your files
3. Type "jar -cvmf Manifest.mf Test2D.jar Test2D.class nehe.png"

This will tell the "jar" command to "[c]reate" a new JAR, be "[v}erbose" about what's going on, use the "[m]anifest" Manifest.mf, and operate on the jar "[f]ile" named Test2D.jar. All other parameters are the files to pack. Note that the order of the parameters matter. If you specify "-cvmf" you must then have "Manifest.mf Test2D.jar". If you instead specify "-cvfm", you must then have "Test2D.jar Manifest.mf". There you go. That should solve your headaches.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #27 - Posted 2003-05-14 22:19:37 »

Blank?

So, this is basically broken in eclipse? Why would they ask for a custom manifest and then not use it? Must be a feature.

Edit: I freaking hate command line tools. Yes CVS, that means YOU. Tongue
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #28 - Posted 2003-05-14 22:35:55 »

It never ends. Now it can't find my frickin .png. (->javax.imageio.IIOException: Can't read input file!)Excuse me while I do perforate my chest with a fork. I'm sure I can figure that one out though, god knows I need to do something for myself at least once today.

At least the manifest works. Tongue I'm gonna have rediculous batch files full of command line operations just like when I use to code with TextPad! woo! Thinking back, that's probably where my hatred comes from.

In hindsight I should have prolly just done what you said origionally, especially since you were trying to help me, but I made the mistake of trusting someone elses software. Tongue

Anyways, thanks for the help guys.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #29 - Posted 2003-05-14 22:53:20 »

> I freaking hate command line tools. Yes CVS, that means YOU.

Hmm... I think you need to get out more.  Grin

Java Game Console Project
Last Journal Entry: 12/17/04
Pages: [1] 2
  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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (43 views)
2014-09-23 14:38:19

radar3301 (25 views)
2014-09-21 23:33:17

BurntPizza (62 views)
2014-09-21 02:42:18

BurntPizza (32 views)
2014-09-21 01:30:30

moogie (37 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!