Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Can anyone run this?

Started by K_I_L_E_R Oct 19, 2003 at 11:36 PM 4 replies 400+ views
Original Post
K_I_L_E_R
K_I_L_E_R
http://members.optusnet.com.au/ksaho/Designs/RPG.jar So far it''s a console app. This will change when I get a good tutorial on using Swing. I made a manifest and checked working JAR files and their manifests and mine is in order. Can anyone tell me why isn''t it autoloading? BTW: I do have the latest Java 2 SDK 1.4.2. Thanks
CaptainJester
CaptainJester
This line:

Main-Class: RPG

should be:

Main-Class: rpg.RPG



First make it work,
then make it fast.

--Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][
K_I_L_E_R
K_I_L_E_R
Thanks, but my app still wont work.
Works well when I compile the sources though. :/
CaptainJester
CaptainJester
I just noticed, your other problem is that manifest.mf has to be in a directory called meta-inf not rpg/meta-inf. meta-inf must be at the root of the directory structure.

Your main class file is not in the right place. Did you declare that each class is part of package rpg. If you are not using packages at this time, then all the files must appear in the root directory.

The file I got from you looked like this:

0 Mon Oct 20 13:08:22 EDT 2003 RPG/
2401 Sun Oct 19 20:53:48 EDT 2003 RPG/combat.class
368 Sun Oct 19 20:53:48 EDT 2003 RPG/enemy.class
1231 Sun Oct 19 20:53:48 EDT 2003 RPG/enemyBase.class
1901 Sun Oct 19 20:53:48 EDT 2003 RPG/equipment.class
620 Thu Oct 16 21:55:36 EDT 2003 RPG/input.class
980 Sun Oct 19 20:53:48 EDT 2003 RPG/inventory.class
659 Sun Oct 19 20:53:48 EDT 2003 RPG/menu.class
0 Mon Oct 20 13:08:22 EDT 2003 RPG/META-INF/
85 Mon Oct 20 13:09:04 EDT 2003 RPG/META-INF/MANIFEST.MF
0 Mon Oct 20 13:08:22 EDT 2003 RPG/myprojects/
0 Mon Oct 20 13:08:22 EDT 2003 RPG/myprojects/rpg/
// \/ \/ this file contains your static main method \/ \/

540 Thu Oct 16 20:33:06 EDT 2003 RPG/myprojects/rpg/RPG$1.class
749 Thu Oct 16 20:33:06 EDT 2003 RPG/myprojects/rpg/RPG.class
640 Sun Oct 19 20:53:48 EDT 2003 RPG/npcAttack.class
521 Sun Oct 19 20:53:48 EDT 2003 RPG/pcAttack.class
653 Sun Oct 19 20:53:48 EDT 2003 RPG/player.class
363 Sun Oct 19 20:53:48 EDT 2003 RPG/potion.class
1921 Sun Oct 19 20:53:48 EDT 2003 RPG/potionDrink.class
1217 Sun Oct 19 20:53:48 EDT 2003 RPG/RPG.class
222 Mon Oct 20 13:06:06 EDT 2003 RPG/RPG.h
818 Sun Oct 19 20:53:48 EDT 2003 RPG/story.class
1335 Sun Oct 19 20:53:48 EDT 2003 RPG/weapons.class

After fixing your directory structure, the archive now looks like this:

0 Tue Oct 21 06:52:46 EDT 2003 META-INF/
85 Tue Oct 21 06:52:46 EDT 2003 META-INF/MANIFEST.MF
2401 Tue Oct 21 06:46:06 EDT 2003 combat.class
368 Tue Oct 21 06:46:06 EDT 2003 enemy.class
1231 Tue Oct 21 06:46:06 EDT 2003 enemyBase.class
1901 Tue Oct 21 06:46:06 EDT 2003 equipment.class
620 Tue Oct 21 06:46:06 EDT 2003 input.class
980 Tue Oct 21 06:46:06 EDT 2003 inventory.class
659 Tue Oct 21 06:46:06 EDT 2003 menu.class
640 Tue Oct 21 06:46:06 EDT 2003 npcAttack.class
521 Tue Oct 21 06:46:06 EDT 2003 pcAttack.class
653 Tue Oct 21 06:46:06 EDT 2003 player.class
363 Tue Oct 21 06:46:06 EDT 2003 potion.class
1921 Tue Oct 21 06:46:06 EDT 2003 potionDrink.class
540 Tue Oct 21 06:46:06 EDT 2003 RPG$1.class
1217 Tue Oct 21 06:46:06 EDT 2003 RPG.class
222 Tue Oct 21 06:46:06 EDT 2003 RPG.h
818 Tue Oct 21 06:46:06 EDT 2003 story.class
1335 Tue Oct 21 06:46:06 EDT 2003 weapons.class


And the program worked.



First make it work,
then make it fast.

--Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][
K_I_L_E_R
K_I_L_E_R
Thanks. It works.

I am using a package btw. Is there anything I should know about packages and Jar files?

[edited by - K_I_L_E_R on October 21, 2003 8:45:02 AM]
garazdawi
garazdawi
only that you have to mirrir the exact directory structure that you used when the app was not in a jar archive......
garazdawi - 'I put the laughter back in slaughter'

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.