Jar file only works on my pc

S

stinkinrich88

OK!

I've recompiled and re-jared the program using my university's
computers (running 1.5) and it works!! On my friends computer! (and on
mine too!). I will create a webstart as well! (thanks Andrew T for
showing me how, It works on my home pc (1.6) but not here at uni (1.5)
like you said.) I'll figure somthing out!

So we've solved the problem!! (but I'm not really sure why)

anyway, thanks for EVERYONE's help! and extra fast responses! I think
I like this forum

feel free to play my game whenever you want, as a reward! haha

Rich
 
A

Andrew Thompson

OK!

I've recompiled and re-jared the program using my university's
computers (running 1.5) and it works!!

Yes. If you graba copy of the 1.5 rt.jar,
you will be able to bild at home on the 1.6
machine as well (and still get 1.5 compatibility)
....On my friends computer! (and on
mine too!). I will create a webstart as well! (thanks Andrew T for
showing me how, It works on my home pc (1.6) but not here at uni (1.5)
like you said.)

Change the part of the JNLP that says '1.6+'
to read '1.5+' and it should be set to go.
feel free to play my game whenever you want, as a reward! haha

To be honest, I still do not understand what
it does, or is supposed to do. But then, I
am not keen on games, and do not have
the patience to try and figure them out. ;-)

Andrew T.
 
A

Andy Dingley

ahh your joking!! I just posted a massive post and it didn't show up.
I clicked "reply to author" and I think it went to Andy. Would you
mind posting it for me please?? sorry! (thanks!)

Here you go:

As a wild guess, it's not the JAR that's at fault. Instead it probably
has a dependency on something that your PC has installed on the
classpath, but their's doesn't.

woooooww, sorry guys, why didn't I get an email telling me I had
replies!? (I'm new to this forum) (sorry, group)

anyway, I'm pretty sure I have the right manistest thing. This is what
I have:

Main-Class: ShutTheBox

in file name "yo" (yes! It has the extra line underneath it!) I had
loads of trouble creating a jar because I didn't think i needed to
include all the ShutTheBox$1.class files! I didn't know what they
were! I have them up to $10. I think theyre somthing to do with my
inner class actionListener things. But I include all of them now, and
the 6 gif files I need.

(ohh, rant about google pages, it looses all the $'s so I can't upload
an applet version there!)

Anyway, it works fine on my computer in any directory, with no other
files in the directory. I open the jar file using 7zip and all
the .class files and gifs are there. And there is a folder called
META-
INF with the manifest in it.

I use textpad to compile it and the command line jar cmf manifest
hello.jar *.class *.gif to create it. Works fine.

Do you recon it's the actuall class? I've uploaded an applet version
to http://www.txfiles.co.uk/rich/ShutTheBox.html. My mate couldn't get
it working on there but, again, it work fine on my pc

thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
A

Andy Dingley

On 3 Feb, 23:18, (e-mail address removed) wrote:
I didn't think i needed to include all the ShutTheBox$1.class files!

1. Yes, you need them. They're to do with anonymous inner classes,
typically generated by GUI code such as Swing. I'm surprised you
didn't include these - I'd expect you to be surprised that they
appeared, but wouldn't the natural assumption be that they're going
to be important for something, even if you don't understand what?

2. Your system still has these on the classpath, even though they're
not in the JAR. The JAR is broken on _both_ machines, but on your PC
the rest of the environment compensates. Obviously they're not on the
other machine, hence the failure.

3. Don't make JARs by hand. It's a painful process and it's horribly
error prone. Right now would be a good time to learn some minimal use
of Ant and to start getting into good habits about automatic builds,
maybe even some automated unit testing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top