| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| oshi-dist-7.5.0.zip | 2026-08-17 | 5.2 MB | |
| README.md | 2026-08-17 | 7.7 kB | |
| Release 7.5.0 source code.tar.gz | 2026-08-17 | 2.8 MB | |
| Release 7.5.0 source code.zip | 2026-08-17 | 3.8 MB | |
| Totals: 4 Items | 11.8 MB | 0 | |
New Features
- #3614 - #3636: Adopt JSpecify nullability annotations project-wide and enforce them in continuous integration with NullAway, so every type in a signature is non-null unless it is annotated
@Nullable. A method not annotated@Nullableis now a checked guarantee rather than an aspiration, and a null check against one is dead code you can delete. The public API packages and theoshi.utiltree carry the marking in theirpackage-info.java, where every consumer sees it, including on a Java 8 or classpath build; the implementation packages are marked on their module descriptors; the native mapping packages underoshi.jnaandoshi.ffm.platformopt out, because nullability there is the operating system's to state rather than OSHI's. Theorg.jspecify:jspecifydependency is optional and compile-time only, so it does not reach your runtime classpath. See the FAQ for what this does and does not promise - @dbwiddis. - #3615: Add
ParseUtil.getStringValueOrEmpty, which normalizes a nullable string to"", alongside the existinggetStringValueOrUnknown- @dbwiddis. - #3641: Add
HardwareAbstractionLayer.getVirtualization(), which identifies the hypervisor, container runtime or cloud platform hosting the system, promoting the long-standingDetectVMdemo into the library. It returns anOptional<String>naming the platform, or an emptyOptionalwhen no signature matched - which means undetermined, not confirmed bare metal. Detection reads the processor's CPUID vendor string, the computer system's manufacturer and model, and network interface MAC address OUIs, in that order. The signature tables ship as theoshi.vm.propertiesandoshi.vmmacaddr.propertiesresources; placing a file of either name earlier on the classpath replaces that table, so you can teach OSHI about a platform it does not know - @dbwiddis. - #3646, #3647: Add
NetworkParams.getRoutes(), which returns the operating system's routing table as a list ofIPRouteobjects covering both address families - @dbwiddis.
Behavior Changes
- #3646:
NetworkParams.getIpv6DefaultGateway()on OpenBSD returns the IPv6 gateway. It previously omitted the-inet6flag and returned the IPv4 gateway.NetworkParamsdefault gateways on AIX return an empty string when no default route is configured, matching the documented contract. They previously returnedConstants.UNKNOWN. - #3614 - #3636: Stating each nullability contract explicitly during the JSpecify sweep surfaced implementations that did not honor it. Values that were documented as unreadable but returned
nullnow return the sentinel the rest of the API uses. The following user-facing behavior changed: DisplayInfo's preferred resolution, model and product serial number return an empty string rather thannullfor a synthesized display such as the Apple Silicon built-in panel.SoundCard.getDriverVersion()andgetCodec()returnConstants.UNKNOWNrather thannullwhen the platform reports neither, and Linux reports an unreadable ALSA driver version asConstants.UNKNOWNrather than the stringnot available.UsbDevice.getVendor()andgetUniqueDeviceId()return an empty string rather thannullon Windows.ComputerSystem,BaseboardandFirmwarefields returnConstants.UNKNOWNrather thannullon AIX, Windows and the BSDs.- An installed application's name, version and vendor return an empty string rather than
nullon every platform. NetworkParams.getDomainName()returns an empty string rather thannullon FreeBSD.- A macOS process whose passwd or group entry cannot be read reports its numeric user and group id through the FFM implementation, matching JNA.
- #3616: Report a disk's model or serial number, and a macOS partition's UUID, as
Constants.UNKNOWNwhen it reads as an empty string, matching every other unreadable value. Affects AIX disks whoselscfgserial field is blank, and the Linux device-mapper and macOS equivalents. Partition filesystem UUIDs and labels are unchanged. - #3641:
NetworkIF.isKnownVmMacAddr()recognizes five more prefixes, so it now returnstruefor a VMware interface using the00:1C:14allocation and for Amazon Web Services and Google Cloud Platform instances.oshi.demo.DetectVM.identifyVM()is deprecated in favor ofHardwareAbstractionLayer.getVirtualization(), and now returns curated product names rather than whichever raw signature happened to match.
Bug Fixes and Improvements
- #3589: Ship
oshi-distas a single.zip, excludingoshi-demoand itsjfreechartandjacksondependencies, and attach it to each GitHub release. Test-javadoc jars andoshi-benchmarkare no longer published - @dbwiddis. - #3611, #3612: Log exceptions with their stack trace and cause chain rather than substituting
getMessage()into the log text, and attach the underlying failure as the cause of theInstantiationExceptionfromAbstractNetworkIFand theUnsatisfiedLinkErrorfromForeignFunctions.dlopenWithFlags. Two Windows logs that had been losing their argument now report it - @dbwiddis. - #3614 - #3636: Harden reads of incomplete platform output, found while stating the nullability contracts above. An empty line in a
/procstatistics file, an AIX logical volume missing its type or partition count, a BSDpsline missing its process state, and a Solaris system with no SMBIOS section of a given type no longer throw. Windows CPU ticks are no longer reported as all zero when an optional processor utility counter is unavailable - @dbwiddis. - #3639: Fix a race in the Windows GPU utilization calculation, which tested its cached previous tick sample for null and then dereferenced it in a second read, so a concurrent poll could throw a
NullPointerException. That sample and the cached ADL adapter index are nowvolatile, as a@ThreadSafeclass requires - @dbwiddis. - #3643: Harden
getSessions()against a corrupt utmpx entry on Linux, macOS, FreeBSD and Solaris. A single unreadable record now skips that one session instead of abandoning the native read and re-querying everything through thewhocommand. The utmpx table is not reentrant, so a session ending while OSHI iterates it can legitimately yield a partially written entry; thewhofallback now applies only when the native read returns nothing at all - @dbwiddis.