A few questions about libvirt-java
Hi, I've been working in a downstream project using libvirt-java to manage resources in libvirt from our application written in Java. The library has been working well so far, but I'm interested in contributing further improvements of the library, such as; - Replace finalize by more modern mechanisms such as (Auto)Closeable (finalize is deprecated in recent OpenJDK versions) - Complete migration to maven (to get rid of maven-ant-tasks which was already retired) However some of the planned contributions (especially the ones listed above) have relatively large impact and I'd like to ask a few questions so that so that we can drive the effort more smoothly. 1. Do you think that these are good/reasonable improvements ? 2. May I request a new release ? The last release (0.5.3) was released 4 years ago and several changes such as new features have been merged since then. Creating a release allows us to mave backword incompatible changes with less user impact. 3. Can we bump minimum JDK version ? Current minimum JSK version supported by the library is 1.8.0 but this is quite old ELS. I wonder if we can bump it to a newer version such as OpenJDK 17 or even 21. This is required to replace "finalize". Is there requirement about the platform the library should support ? Any feedback or guidance is very much appreciated ! Thank you, Takashi -- Takashi Kajinami irc: tkajinam github: https://github.com/kajinamit launchpad: https://launchpad.net/~kajinamit
On Sun, Mar 15, 2026 at 08:13:51PM +0900, Takashi Kajinami wrote:
Hi,
I've been working in a downstream project using libvirt-java to manage resources in libvirt from our application written in Java. The library has been working well so far, but I'm interested in contributing further improvements of the library, such as;
- Replace finalize by more modern mechanisms such as (Auto)Closeable (finalize is deprecated in recent OpenJDK versions)
- Complete migration to maven (to get rid of maven-ant-tasks which was already retired)
However some of the planned contributions (especially the ones listed above) have relatively large impact and I'd like to ask a few questions so that so that we can drive the effort more smoothly.
1. Do you think that these are good/reasonable improvements ?
The challenge we have with libvirt-java is that none of the active libvirt core maintainers have much expertise in Java. If you're actively building Java apps using libvirt-java, then you're better placed to suggest improvements. We can advise on libvirt related integration matters, but for Java "best practice" we'll defer to those with more knowledge.
2. May I request a new release ? The last release (0.5.3) was released 4 years ago and several changes such as new features have been merged since then. Creating a release allows us to mave backword incompatible changes with less user impact.
Looks like I was responsible for that last release, so I'll see about creating a new one.
3. Can we bump minimum JDK version ? Current minimum JSK version supported by the library is 1.8.0 but this is quite old ELS. I wonder if we can bump it to a newer version such as OpenJDK 17 or even 21. This is required to replace "finalize". Is there requirement about the platform the library should support ?
Libvirt's general policy has been to target the 2 most recent major releases of common OS distros: https://libvirt.org/platforms.html In the absence of an explicit different policy for libvirt-java, we can use the common policy as a guide. JDK 1.8.0 is so ancient we can definitely modernize quite a long way forward. The older supported platforms are Ubuntu 22.04 / RHEL-9, but AFAICT both of them include OpenJDK 21 support. So that sounds viable as an upgrade. With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
Hi Daniel, Thanks for your inputs ! # I'd like to also thank you for your help for reviewing patches. I have now clear view about the current status. Proposing updates to align the library with recent best practise in java is the area we can definitely help. I'll discuss further details with my team mates based on these inputs and will start proposing PRs soon, hopefully. On 3/17/26 7:46 PM, Daniel P. Berrangé via Devel wrote:
On Sun, Mar 15, 2026 at 08:13:51PM +0900, Takashi Kajinami wrote:
Hi,
I've been working in a downstream project using libvirt-java to manage resources in libvirt from our application written in Java. The library has been working well so far, but I'm interested in contributing further improvements of the library, such as;
- Replace finalize by more modern mechanisms such as (Auto)Closeable (finalize is deprecated in recent OpenJDK versions)
- Complete migration to maven (to get rid of maven-ant-tasks which was already retired)
However some of the planned contributions (especially the ones listed above) have relatively large impact and I'd like to ask a few questions so that so that we can drive the effort more smoothly.
1. Do you think that these are good/reasonable improvements ?
The challenge we have with libvirt-java is that none of the active libvirt core maintainers have much expertise in Java. If you're actively building Java apps using libvirt-java, then you're better placed to suggest improvements.
We can advise on libvirt related integration matters, but for Java "best practice" we'll defer to those with more knowledge.
2. May I request a new release ? The last release (0.5.3) was released 4 years ago and several changes such as new features have been merged since then. Creating a release allows us to mave backword incompatible changes with less user impact.
Looks like I was responsible for that last release, so I'll see about creating a new one.
3. Can we bump minimum JDK version ? Current minimum JSK version supported by the library is 1.8.0 but this is quite old ELS. I wonder if we can bump it to a newer version such as OpenJDK 17 or even 21. This is required to replace "finalize". Is there requirement about the platform the library should support ?
Libvirt's general policy has been to target the 2 most recent major releases of common OS distros:
https://libvirt.org/platforms.html
In the absence of an explicit different policy for libvirt-java, we can use the common policy as a guide.
JDK 1.8.0 is so ancient we can definitely modernize quite a long way forward.
The older supported platforms are Ubuntu 22.04 / RHEL-9, but AFAICT both of them include OpenJDK 21 support. So that sounds viable as an upgrade.
IIUC the default OpenJDK version in these operating system versions are bit older (11 in Ubuntu 22.04 and 17 in RHEL9/CentOS Stream 9), but newer LTS versions (21 or even 25) are also packages. I guess we can set our first target to 11, but will check if we can/should bump it further.
With regards, Daniel
Thank you, Takashi Kajinami
On Wed, Mar 18, 2026 at 03:00:04AM +0900, Takashi Kajinami wrote:
On 3/17/26 7:46 PM, Daniel P. Berrangé via Devel wrote:
On Sun, Mar 15, 2026 at 08:13:51PM +0900, Takashi Kajinami wrote:
3. Can we bump minimum JDK version ? Current minimum JSK version supported by the library is 1.8.0 but this is quite old ELS. I wonder if we can bump it to a newer version such as OpenJDK 17 or even 21. This is required to replace "finalize". Is there requirement about the platform the library should support ?
Libvirt's general policy has been to target the 2 most recent major releases of common OS distros:
https://libvirt.org/platforms.html
In the absence of an explicit different policy for libvirt-java, we can use the common policy as a guide.
JDK 1.8.0 is so ancient we can definitely modernize quite a long way forward.
The older supported platforms are Ubuntu 22.04 / RHEL-9, but AFAICT both of them include OpenJDK 21 support. So that sounds viable as an upgrade.
IIUC the default OpenJDK version in these operating system versions are bit older (11 in Ubuntu 22.04 and 17 in RHEL9/CentOS Stream 9), but newer LTS versions (21 or even 25) are also packages. I guess we can set our first target to 11, but will check if we can/should bump it further.
In fact Ubuntu 22.04 is about to drop off our build target list, as Ubuntu 26.04 should be arriving very soon now, leaving us with only 24.04 and 26.04 to worry about. CentOS 9 will be around for a bit over another year, before it would be eligible for retirement from libvirt's platform target list, under the "2 year overlap" rule. So probably OpenJDK 17 is a viable min target already. With regards, Daniel -- |: https://berrange.com ~~ https://hachyderm.io/@berrange :| |: https://libvirt.org ~~ https://entangle-photo.org :| |: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
participants (2)
-
Daniel P. Berrangé -
Takashi Kajinami