Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (578)
games submitted by our members
Games in WIP (498)
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 5119 times)
0 Members and 1 Guest are viewing this topic.
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #30 - Posted 2003-05-15 02:15:41 »

I'm just bitching cause yesterday I wanted to look at someones (i wont name names) code on sourceforge and i just wanted to get on and grab it as fast as possible.

If I was going to use it more then once then I would peek around. I should just use it anyways, just to learn some amount of source control, interesting thought. Mabey when I can get a Jar file to work properly I'll look into it.

*cough*cas*cough*spgl*cough*

Smiley
Offline jbanes

JGO Coder


Projects: 1


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


« Reply #31 - Posted 2003-05-15 02:41:30 »

Sourceforge, eh? Yeah, they're loads of fun when you're working on a project. For quick and easy checkout tho, it really isn't too bad. Let me show you some voodoo:

1. Go to http://www.cygwin.com, download cygwin and install.

2. Run cygwin

3. If you don't have a c:\temp folder, create it with the following command at the "bash$" prompt:

bash$ mkdir /cygdrive/c/temp

4. Create c:\temp\spgl and change to that directory::

bash$ mkdir /cygdrive/c/temp/spgl
bash$ cd /cygdrive/c/temp/spgl

5. Now for the fun part. Perform the following commands. These are the ones from the sf pages, more or less verbatim:

bash$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/spgl login
password: (press enter without entering anything)
bash$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/spgl co .


You'll note the "." after the co (short for checkout). This means "get me everything". Literally it means "the current directory" as in "cd .". So replacing "." with "spgl-tools" would get you only the spgl tools.

BTW, if you find yourself working with SF a lot, I highly recommend getting TortoiseCVS.

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

Junior Member




Are you suggesting coconuts migrate?


« Reply #32 - Posted 2003-05-15 03:01:12 »

Oh, I should have implied I got it working.

It's just I wanted it 5 minutes ago and I had to read text files and webpages to figure out how to install (my install.txt seemed to be MIA on the version I dwnloaded) and get the code. SF acually had a nice explaination of the login portion you just mentioned.

To d/l, install, and grab the code, it took me about 20 minutes. But I was highly annoyed at the time. Tongue
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #33 - Posted 2003-05-15 08:56:27 »

Ok I don't get it.

This is what I'm doing now. I have a batch file that looks like this:

jar -cvmf MANIFEST.MF Test2D.jar Test2D.class nehe.png
del c:\Test2D\Test2D.jar
move Test2D.jar c:\Test2D\

and a manifest file that looks like this:

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


and my program can't find the nehe.png when I tried to new File( "nehe.png" ); So now it's finding the jar, yay, but why can't it find an image in the current directory?
Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #34 - Posted 2003-05-15 09:42:57 »

For fun I checked the eclipse page and there was a new version. Telling eclipse to use a custom manifest from the workspace and giving it

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

seems to work like doing it by the commandline. Now, I dunno if this would have worked in the old version or not, it might do something silly (which now it acually looks like thats what it was) like require that first line with the version etc otherwise it generates one with JUST the version.

It still doesn't find my .png though. Smiley
Offline Backmask

Junior Member




586: The average IQ needed to understand a PC


« Reply #35 - Posted 2003-05-15 10:52:04 »

This is how I load my images in an jar file

1  
2  
3  
4  
5  
6  
7  
8  
9  
         URL url = YOURCLASSNAME.class.getResource("nehe.png");

         Image tempImage = null;
         if (url == null)
                  // Load image from file.
                 tempImage = new ImageIcon(filename).getImage();
            else
                  // Load image from URL
                 tempImage = new ImageIcon(url).getImage();


Change YOURCLASSNAME to the name of the class you are using this code in.

Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #36 - Posted 2003-05-15 12:14:47 »

I wasn't aware that using a URL would matter.

URL url = Test2D.class.getResource( path );
Image image = ImageIO.read( url );

These 2 lines appear to work just fine, thanks.


Now I need to find a way to kill this thread, it's embarassing. Tongue
Offline Backmask

Junior Member




586: The average IQ needed to understand a PC


« Reply #37 - Posted 2003-05-15 14:17:07 »

LOL... well it starting to get quite large...  Grin

Offline elias

Senior Member





« Reply #38 - Posted 2003-05-15 17:06:43 »

Psiegel: what's wrong with -Djava.librarypath=<stuff> on linux?

- elias

Offline psiegel

Junior Member




Adamant about gaming.


« Reply #39 - Posted 2003-05-15 18:37:09 »

Hmm, I had to go back and reread my original post on this very issue:

http://www.java-gaming.org/cgi-bin/JGOForums/YaBB.cgi?board=LWJGL;action=display;num=1051537039;start=0

It looks like the only problem with that was that I was using 0.5.  I'll have to go back and re-test with 0.6.  Unfortunately right now other work is keeping me stuck in Windows land.

By the by, call me Paul.

-Paul

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 psiegel

Junior Member




Adamant about gaming.


« Reply #40 - Posted 2003-05-16 12:35:45 »

Got back into Linux this morning and ran some tests using -Djava.library.path instead of setting the LD_LIBRARY_PATH environment variable.  It appears to work exactly as you've said.  Nice work.

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

Senior Member





« Reply #41 - Posted 2003-05-16 12:40:43 »

That's just it - I was suspicious of it not working exactly because it _shouldn't_ be my job. The library path is where java looks for native libs (including the lwjgl library), and lwjgl has nothing to do with the way the path is searched nor how the lib is loaded. Another thing would be the loading of the openal and gl library, which Matzon had to tweak to make it work with java.library.path.

But I'm glad it works.

- elias

Offline kalleh

Senior Newbie




Java games rock!


« Reply #42 - Posted 2003-05-24 15:49:24 »

I've seen some discussion on how to get LWJGL running under Linux.  On my box running MDK 9.1 i just throw in all the so:s in the same dir as the app and then do a:

LD_LIBRARY_PATH = .
export LD_LIBRARY_PATH

java -cp lwjgl.jar MyCoolApp

Thats it!

You can set LD_LIBRARY_PATH to any path that points to the dynamic libs, not just '.' If your system uses LD_LIBRARY_PATH a more gentle command might also be:

LD_LIBRARY_PATH = $LD_LIBRARY_PATH:/path/to/libs
export LD_LIBRARY_PATH

I usually just set up a shellscript with the above contents that  run the above and then start the app.

Good Luck all Free people with Free OS:s Smiley

Kalle






Quote
That's just it - I was suspicious of it not working exactly because it _shouldn't_ be my job. The library path is where java looks for native libs (including the lwjgl library), and lwjgl has nothing to do with the way the path is searched nor how the lib is loaded. Another thing would be the loading of the openal and gl library, which Matzon had to tweak to make it work with java.library.path.

But I'm glad it works.

- elias

Offline bedelf

Junior Member




Are you suggesting coconuts migrate?


« Reply #43 - Posted 2003-06-01 14:57:41 »

Oh my GOD. So in my new project I just tried to export to a jar and it didn't work. Sigh. <----

So this is the low-down:

I'm typing this:
jar -cvmf MANIFEST.MF Blah.jar Blah.class

The MANIFEST looks like this:
Manifest-Version: 1.0
Main-Class: Blah
Class-Path: lwjgl.jar



and when I unjar it, the directory structure looks like this:
Blah.class
META-INF/MANIFEST.MF

the contents of the manifest are changed to this:
Manifest-Version: 1.0
Class-Path: lwjgl.jar
Created-By: 1.4.1_02 (Sun Microsystems Inc.)
Main-Class: Blah



Any ideas? I thought I had this problem snuffed but I guess not.

edit: for fun mabey i should say what the error message is? Tongue just says main class not found
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.

xsi3rr4x (26 views)
2014-04-15 18:08:23

BurntPizza (21 views)
2014-04-15 03:46:01

UprightPath (37 views)
2014-04-14 17:39:50

UprightPath (19 views)
2014-04-14 17:35:47

Porlus (35 views)
2014-04-14 15:48:38

tom_mai78101 (61 views)
2014-04-10 04:04:31

BurntPizza (119 views)
2014-04-08 23:06:04

tom_mai78101 (219 views)
2014-04-05 13:34:39

trollwarrior1 (186 views)
2014-04-04 12:06:45

CJLetsGame (193 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!