Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (686)
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  
  Stupid JAR Question  (Read 2326 times)
0 Members and 1 Guest are viewing this topic.
Offline stefanha

Senior Newbie

I love YaBB 1G - SP1!

« Posted 2003-03-15 14:40:36 »

I can't get JAR files to work with my (applet) game.  I have compiled my game.  The class belong to two packages: and  Now I want to make one JAR file containing all of the classes (from both packages) plus a directory with graphics (GIF images).

I have managed to make a JAR file, but the paths were absolute paths (as in "C:\My Documents\Boom\").  Can someone explain the process of creating one JAR file containing all my classes and images, and then making an HTML file that starts the applet from the JAR file?

Thanks, Stefan
Offline augusto

Senior Newbie

« Reply #1 - Posted 2003-03-15 19:20:56 »

How are you creating the jar file?

Anyways, sounds like you need to use the -C option, make it go to the top directory (above your com hirarchy) and then the path should be relative from there.
Offline stefanha

Senior Newbie

I love YaBB 1G - SP1!

« Reply #2 - Posted 2003-03-18 07:23:18 »

Okay, what I've done now, after checking out the -C option, is to just copy all my class files to the same location, and to JAR that.  It works, BUT I'm having trouble accessing the applet.

My HTML file looks like this:
<applet archive="Boom.jar" code="Boom.class" width=320 height=200></applet>

I get an error - the VM can't load/find the class.  So I guess that means I need to use its full packaged name, com.stefanha.boom.Boom, but that doesn't work either.

What is the correct way to run an applet from a JAR file when it is in a package?

from, Stefan
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline stefanha

Senior Newbie

I love YaBB 1G - SP1!

« Reply #3 - Posted 2003-03-20 13:09:26 »

Somebody please answer: it's so frustrating to have a game ready, but not be able to release it on the internet!

Anyway, if anyone can just describe in general how you can JAR an applet whose class is in a package, and run it from a browser, please answer...

from, Stefan
Offline zparticle

Senior Devvie

Thick As A Brick

« Reply #4 - Posted 2003-03-20 13:29:39 »

Use a tag simlar to the one below.


Make sure your classes are in the correct directories inside of the jar. You can do that by opening the jar with WinZip or "jar -t jarfile" I think.

Take a look at the jar file that uses the above tag:

Offline wiesi

Senior Newbie

Java rulez!

« Reply #5 - Posted 2003-05-21 14:48:37 »

or if you don't use the java-plugin you should try "javac -target 1.1"

Offline swpalmer

JGO Coder

Exp: 12 years

Where's the Kaboom?

« Reply #6 - Posted 2003-05-23 13:26:30 »

You didn't specify the package in the code= part of the applet tag.  You said you were using a package so it should read something like code="" I assume.  Note that you don't add the ".class"

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

Dwinin (61 views)
2015-11-07 13:29:08

Rems19 (75 views)
2015-10-31 01:36:56

Rems19 (68 views)
2015-10-31 01:32:37

williamwoles (103 views)
2015-10-23 10:42:59

williamwoles (91 views)
2015-10-23 10:42:45

Jervac_ (103 views)
2015-10-18 23:29:12

DarkCart (131 views)
2015-10-16 00:58:11

KaiHH (113 views)
2015-10-11 14:10:14

KaiHH (153 views)
2015-10-11 13:26:18

BurntPizza (166 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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‑
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!