Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to restart Java VM? #411

Open
bgyori opened this issue Mar 4, 2019 · 4 comments
Open

Is it possible to restart Java VM? #411

bgyori opened this issue Mar 4, 2019 · 4 comments

Comments

@bgyori
Copy link
Contributor

bgyori commented Mar 4, 2019

Is there any way to restart the Java VM after having imported autoclass? The motivation for this would be to be able to change the VM configuration during runtime (e.g., put a new JAR file on the CLASSPATH). This is currently explicitly disallowed, see for instance: https://github.com/kivy/pyjnius/blob/master/jnius_config.py#L18
Given that it is not possible to change configurations while the VM is running, I was wondering if one could change the configuration and restart the VM for the change to take effect.

@kevinmartinjos
Copy link

I would be interested in something like this as well

@tshirtman
Copy link
Member

Is #434 any help?

@bgyori
Copy link
Contributor Author

bgyori commented Oct 10, 2019

@tshirtman no, #434 describes a standard method to be able to import autoclass in multiple submodules of a package while having the Java VM launched in a consistent place - this is all fine and I've been using this routinely myself. However, this does not solve the issue of being able to restart the Java VM during runtime (with a different configuration each time), or to have multiple modules use different Java VMs with different configurations simultaneously.

@bgyori
Copy link
Contributor Author

bgyori commented Oct 10, 2019

Looking more closely, I realize you may be referring to the Stackoverflow link in that thread rather than the main issue raised in the thread. The addPath method seems interesting, I'll look into it, but I am not sure it will work in my case since I would need to be able to both add and remove JARs from the CLASSPATH (due to conflicting JARs used by different modules that cannot be simultaneously on the CLASSPATH).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants