Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to pack everything within jar file in netbeans

 
Sanjeev Charla
Ranch Hand
Posts: 90
Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to make a single unique jar file with all related resources ( icons, images etc) contains in itself, in netbeans ??

thank you.
 
Ifteqar Ahmed
Ranch Hand
Posts: 85
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sandeep, NetBeans automatically creates the war file. you dont have to do anything. just open your project space folder and you will find one jar file. The only thing you have to do is just build the project in Netbeans
 
Sanjeev Charla
Ranch Hand
Posts: 90
Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


for a code like the above, i have to place a folder images/ and place icon.png in this folder at the jar file's location, like this.

----->dist/
----->dist/MyApplication.jar
----->dist/images/
----->dist/images/icon.png


but i want to move the images folder in to the jar file. for that how i have to code ??



 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A resource in a jar file is not itself a file. Please go through the Swing tutorial on How to Use Icons and particularly the section on Loading Images Using getResource.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic