Update contents of a file within a jar file

By: Naren Viewed: 153617 times    

Recently there was a change of IPs in my servers. Therefore some of the applications stopped working. For example, there was an application that was running as an executable jar file. The access to other resources from that application was using IP Addresses and there was a config file named bcconfig.xml that had all the IP addresses of various resources the application needs to access.

This bcconfig.xml was bundled within the jar file and as this was a legacy application we did not want to recompile the source files and regenerate the entire jar file. So what we did is to just make changes to bcconfig.xml and repackage it to the same jar file. If you are facing with similar issue, then there is a simple method to just update the bcconfig.xml file and update the jar file. Once your bcconfig.xml file is ready with the new IP addresses, just run the below command to update the jar

#jar uf mlsscheduler.jar bcconfig.xml

The other way to do is to just use applications such as WinRAR to open the jar file and then drag and drop the files in it. :). It really works.

Most Viewed Articles (in Java )

Latest Articles (in Java)

Comment on this tutorial

Subscribe to Tutorials

Related Tutorials

Archived Comments

1. New
View Tutorial          By: appss at 2015-07-11 09:41:48

2. I want to be programer
View Tutorial          By: somphone at 2015-09-09 11:20:20

3. in need of coading for keeping the compared string
View Tutorial          By: roja at 2016-02-04 07:44:11

4. By reading your blog post i realize that I can bec
View Tutorial          By: Maheswari at 2016-03-15 06:52:09

5. Another great information,i like this kind of blog
View Tutorial          By: priyatamil at 2016-03-22 12:43:52

6. very informative blog. Helps to gain knowledge abo
View Tutorial          By: Geetha at 2016-04-16 10:07:58

7. I simply want to say Iâm very new to blogs
View Tutorial          By: Pallavi at 2016-07-06 11:31:11

8. I want to be programmer
View Tutorial          By: kawaljit kaur at 2016-08-13 16:50:29

9. Hi,

I wanted to ask if you'd consid

View Tutorial          By: Ankit at 2016-09-12 12:44:42

10. Hi,

Just following up on my email s

View Tutorial          By: Ankit at 2016-09-18 05:56:11

11. Hi,

I wanted to follow up one more

View Tutorial          By: Ankit at 2016-09-24 06:39:53

12. Hi,

I wanted to follow up one more

View Tutorial          By: Ankit at 2016-09-24 06:40:15

13. Les autres sont matelasses [url=http://www.sophiec
View Tutorial          By: salon de massage lyon at 2017-03-30 05:24:15

14. Heyaa i'm for the primary time here. I came across
View Tutorial          By: pligg.in at 2017-05-03 07:11:31

15. Wonderful blog youu have here bbut I was cujrious
View Tutorial          By: free to play games 2015 at 2017-05-09 09:26:28

16. After I initially cpmmented I seem to have clicked
View Tutorial          By: fifa world cup game at 2017-05-27 12:09:20

17. Great blog rijght here! Additionally your website
View Tutorial          By: fifth avenue elementary school at 2017-05-30 02:38:10

18. For the reason that the admin of this web page is
View Tutorial          By: princess kouka of sudan wiki at 2017-05-30 09:20:56

19. Hi, I do think this is an excellent site. I stumbl
View Tutorial          By: buy rs mills at 2017-06-08 17:10:41

20. Hey! Woud you mind if I share your blog with my tw
View Tutorial          By: xbox one elder scrolls online beta release date at 2017-06-10 05:34:14

21. Attractive element of content. I just stumbhled up
View Tutorial          By: old testament game at 2017-06-11 05:26:26

22. Heey there, I think your site might be having brow
View Tutorial          By: download game mmorpg at 2017-06-11 12:33:10

23. Thanks foor the good writeup. It in fact was a amu
View Tutorial          By: Revelation Online Coins at 2017-06-11 18:09:14

24. I'm using Firefox with some paranoia settings. Eit
View Tutorial          By: Really? at 2017-07-09 19:43:06

25. magnificent points altogether, you juset gained a
View Tutorial          By: https://www.virsale.com/ at 2017-08-02 06:30:20