On Sat, 27 Feb 2010, Roman Chyla wrote:
I would like to unload JVM in some situations (to reload it). The
usecase is this:
- vmargs can be passed only once
Yes, a VM can only be initialized once.
- consecutive calls to initVM raise errors
Only if you use parameters other than classpath, right ?
Or did you find a different problem ?
- in my program components interact with several JCC wrapped libraries
Normally, it is no problem, but clashes may occur - especially in GUI
when running complex workflows - the solution (in theory) would be to
destroy JVM and load it again. Is it possible?
In theory, it might be. The JNI API has a call to destroy a VM.
http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/invocation.html
But cleanly doing so it rather tricky so JCC doesn't support it.
A different approach to supporting your use case might be to consider
compiling all your JCC wrapped libraries into one, picking only the APIs you
need so as control the size of the resulting library.
Andi..