Results 1 to 5 of 5
- 02-22-2012, 02:59 AM #1
Member
- Join Date
- Feb 2012
- Posts
- 2
- Rep Power
- 0
Adding files to a jar file at runtime
I've searched google but can't find anything simple and quality.
Scenario:
There's a jar file with a bunch of classes in it. You have created new class files, and have edited a few existing ones. You want other people to be able to install these class files into THEIR jar easily, without releasing the entire new jar. So, I need an auto installer that will copy and paste/replace my class files into the jar file.
Thanks in advance for your responses.
- 02-22-2012, 07:37 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: Adding files to a jar file at runtime
Without extracting and re-creating the jar file, I don't think there is another way to do this.
- 02-22-2012, 09:41 AM #3
Re: Adding files to a jar file at runtime
In any case, 'replacing' .class files in a .jar of a running application doesn't make the new version of the class available to the application. At least, not without some very fancy class loading mechanism.
Also note that not every OS will allow you to delete and replace the .jar while an application is running.
For automatic updates when launching the application, look into using JNLP / Web Start.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 02-28-2012, 10:07 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Re: Adding files to a jar file at runtime
Normally, version upgrade is kind of packages replacement. Not a *.class file. However, you have to take care about the associations that your application has with the OS.
- 02-28-2012, 10:45 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Adding to ClassPath at runtime - ClassPathHacker.java - safe?
By rc_coder in forum Advanced JavaReplies: 8Last Post: 09-23-2010, 03:27 PM -
Adding jars at runtime
By tbar0711 in forum Enterprise JavaBeans (EJB)Replies: 0Last Post: 02-17-2010, 07:25 PM -
Problem in adding new JTextPane at Runtime
By png in forum AWT / SwingReplies: 13Last Post: 12-14-2009, 12:14 PM -
Adding component at runtime
By Beju in forum Java AppletsReplies: 5Last Post: 06-16-2009, 11:28 AM -
Adding JARs to the classpath at runtime?
By johann_p in forum Advanced JavaReplies: 1Last Post: 06-26-2007, 10:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks