Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jar File question

 
Sam Stackly
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I've tried to run my client application jar but I am getting wired exception as I copied below
is there anything wrong with my system or my jar has problem?
thanks
Sam
btw, here is the code and message

C:\suncertify>java -jar FBNCLinet.jar
Exception in thread "main" java.util.zip.ZipException: The system cannot find the file specified
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sam,
It looks like you may be trying to load something from the jar file as a file instead of a resource.
You have to load things up in a jar as a URL similar to this:

Hope this helps,
Michael Morris
 
Sam Stackly
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael,
Sam
 
Sam Stackly
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael,
I followed your comment and changed my help file path by using URL. but I am still getting that error. I really don't know what to do , any idea or comment??
Thanks in advance
Sam
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm afraid loading resources from jar files works only for gifs, jpgs, and .au files (but I am not 100 percent sure on this - anybody out there who knows for sure?).
I am circumventing this problem by putting my help file into a separate directory.
 
Nate Johnson
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mag Hoehme:
I'm afraid loading resources from jar files works only for gifs, jpgs, and .au files (but I am not 100 percent sure on this - anybody out there who knows for sure?).
I am circumventing this problem by putting my help file into a separate directory.

I loaded my html help file from my client jar, so I can say that at least html can be added to that list .
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sam,

I followed your comment and changed my help file path by using URL. but I am still getting that error. I really don't know what to do , any idea or comment??

Are you attempting to save a file to the local jar? I'm not sure that is possible. I recall reading a post on one of the Java in general forums about the same problem that you are having and as I recall the consensus was that it was not possible.
And by the way, you can load anything in the local jar as a resource including simple files. I just don't think it is possible to save anything back to it.
Michael Morris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic