Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Jar file only works on my pc

Reply
Thread Tools

Jar file only works on my pc

 
 
stinkinrich88@googlemail.com
Guest
Posts: n/a
 
      02-04-2007
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

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      02-04-2007
On Feb 5, 1:24 am, (E-Mail Removed) wrote:
> 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.

 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      02-05-2007
On 3 Feb, 23:18, (E-Mail Removed) wrote:

> 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:

On 3 Feb, 16:05, "Andy Dingley" <(E-Mail Removed)> wrote:
> On 3 Feb, 13:33, (E-Mail Removed) wrote:
>
> > Hello! I've created a jar file, works fine on my pc (in any directory)
> > but won't work on anyone elses computer.

>
> 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!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      02-05-2007
On 5 Feb, 11:02, "Andy Dingley" <(E-Mail Removed)> wrote:
> On 3 Feb, 23:18, (E-Mail 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java -cp a.jar -jar b.jar => Works on Windows, not on Debian cyberco Java 4 02-14-2006 06:27 AM
jaas.jar, jta.jar jdbc-stdext.jar missing from jdk1.5 RPM muttley Java 0 10-20-2005 02:40 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters Java 0 01-05-2005 10:59 PM
Differences of xercesImpl.jar, xercesImpl-J.jar, dom3-xercesImpl.jar ? Arnold Peters XML 0 01-05-2005 10:59 PM
how to disassembly a .jar file? how to see what are the classes inside the .jar file? lucy Java 6 09-07-2004 09:54 PM



Advertisments