2

After compiling my program into a jar, I split it into two pieces. I want one piece to download the other half and run like they're "one jar" every time the program starts.

Part 1) is the user client, and still can be run by itself long enough to download Part 2.

Part 2) contains some essential classes that are referenced by Part 1. It is hosted on a server, and downloaded by the client, Part 1.

Both parts are jar files that run perfect while consolidated as one jar file. I already have a working method for downloading the Part 2 jar with Part 1, but I'm not sure how to load Part 2's content into the JVM in such a way that Part 1 can continue running like it's complete.

I attempted to use URLClassLoader, but I can't find any examples of it being used to achieve what I want.

Can someone please help me?

Travis
  • 21
  • 3
  • http://en.wikipedia.org/wiki/OSGi –  Jul 14 '14 at 12:37
  • @Rafael Sorry, I was hoping for a more quick and dirty solution. I get the feeling that what I'm looking for exists in a hacky form, and I can't afford to implement OSGi at this point. – Travis Jul 14 '14 at 18:38

1 Answers1

0

I found a solution to what I wanted in this question. It forces the SystemClassloader to add a jar like a library at runtime. Leaving it here for reference, since I had trouble drawing the connection despite reading that same article multiple times before posting.

Community
  • 1
  • 1
Travis
  • 21
  • 3