This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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: 5125
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic