We need to package an extension jar file when deploying a Java client with webstart. The extension jar need to be installed under jre/lib/ext
and make it available to the java client when started by WebStart.
I managed to copy the files to the right location, but the problem I was facing was that after I installed the extension jar under lib/ext
, I needed to restart the client JVM in order to pick up the new jar.
How to avoid needing to restart the JVM?
How to avoid needing to restart the JVM?
You can't AFAIU. Classloaders typically do not reload classes or other resources, and I imagine it would be impossible or impractical to change the bootstrap & other JRE related classloaders (or change them soon enough to make a difference).
An alternate strategy might be to:
installer-desc
extension this run and:
BasicService.showDocument(URL)
using the JNLP URL to start a new instance.System.exit(0)
on the current instance to end it.It might pay to pop a JOptionPane
to confirm the restart. E.G.
To encode OGG right away, restart the app.
Restart?OK Cancel
As an aside. It is generally advised to not put archives into any directory of the JRE.