• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with executable jar's  RSS feed

 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i thought i understood this subject, but i just noticed my executable jar's work fine in the directory they are created in, but if i copy them to a different folder they "lose" their resource files(gif's and a rtf)

i am doing it like this
jar cmf Manifest.mf word.jar bold.gif......Word.class

sorry, but i'm confused
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Randall Twede wrote:but if i copy them to a different folder they "lose" their resource files(gif's and a rtf)

In your code, how are you accessing the resources? The correct way is

http://docs.oracle.com/javase/tutorial/deployment/webstart/retrievingResources.html
 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Randall,

So you need to include the resources into your jar file, then use the syntax suggested by Maneesh to access them.
If you keep the resources out of the jar file, use relative paths instead of absolute ones.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nam Ha Minh wrote:
So you need to include the resources into your jar file, ..

I think Randall is already doing it.
jar cmf Manifest.mf word.jar bold.gif......Word.class
 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:
Nam Ha Minh wrote:
So you need to include the resources into your jar file, ..

I think Randall is already doing it.
jar cmf Manifest.mf word.jar bold.gif......Word.class


Yeah, I noticed that now. Overlooked!
Thanks.
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i am accessing them wrong. i will try as you suggest. i was doing it like this


 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ignoring these kinds of exceptions will generally lead to problems - at least print a message to the console so that you'll know when a problem occurs.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!