{"id":13458744,"url":"https://github.com/oshi/oshi","last_synced_at":"2025-09-09T21:13:22.485Z","repository":{"id":2437269,"uuid":"3407114","full_name":"oshi/oshi","owner":"oshi","description":"Native Operating System and Hardware Information","archived":false,"fork":false,"pushed_at":"2025-04-28T03:38:25.000Z","size":335542,"stargazers_count":4940,"open_issues_count":8,"forks_count":895,"subscribers_count":102,"default_branch":"master","last_synced_at":"2025-05-05T20:39:56.723Z","etag":null,"topics":["cpu-usage","disk-utilization","hacktoberfest","hardware-information","java","jna","memory-usage","operating-system","process-list","processor","serialnumbers","system-monitoring","usb-devices"],"latest_commit_sha":null,"homepage":"https://oshi.ooo","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oshi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["dbwiddis","dblock"],"tidelift":"maven/com.github.oshi:oshi-core"}},"created_at":"2012-02-10T12:46:48.000Z","updated_at":"2025-05-04T13:26:47.000Z","dependencies_parsed_at":"2023-02-19T04:46:08.739Z","dependency_job_id":"ed07d40f-2f12-4024-9a42-02c6b72b0b04","html_url":"https://github.com/oshi/oshi","commit_stats":{"total_commits":2767,"total_committers":205,"mean_commits":"13.497560975609757","dds":0.4058547162992411,"last_synced_commit":"40be04935ad7ce83250cabcad7aafb2f02973a24"},"previous_names":[],"tags_count":182,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oshi%2Foshi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oshi%2Foshi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oshi%2Foshi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oshi%2Foshi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oshi","download_url":"https://codeload.github.com/oshi/oshi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253929349,"owners_count":21985802,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpu-usage","disk-utilization","hacktoberfest","hardware-information","java","jna","memory-usage","operating-system","process-list","processor","serialnumbers","system-monitoring","usb-devices"],"created_at":"2024-07-31T09:00:56.451Z","updated_at":"2025-09-09T21:13:22.470Z","avatar_url":"https://github.com/oshi.png","language":"Java","readme":"![OSHI](https://dl.dropboxusercontent.com/s/c82qboyvvudpvdp/oshilogo.png)\n\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.oshi/oshi-core.svg?label=Maven%20Central)](https://central.sonatype.com/search?namespace=com.github.oshi\u0026sort=name)\n[![first-timers-only](https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square)](https://www.firsttimersonly.com/)\n[![Openhub Stats](https://www.openhub.net/p/oshi/widgets/project_thin_badge.gif)](https://www.openhub.net/p/oshi?ref=github)\n\nOSHI is a free JNA-based (native) Operating System and Hardware Information library for Java.\nIt does not require the installation of any additional native libraries and aims to provide a\ncross-platform implementation to retrieve system information, such as OS version, processes,\nmemory and CPU usage, disks and partitions, devices, sensors, etc.\n\n- [Supported Platforms](#supported-platforms)\n- [Downloads and Dependency Management](#downloads-and-dependency-management)\n- [Documentation](#documentation)\n- [Usage](#usage)\n- [Supported Features](#supported-features)\n- [Support](#support)\n- [OSHI for Enterprise](#oshi-for-enterprise)\n- [Security Contact Information](#security-contact-information)\n- [Continuous Integration Test Status](#continuous-integration-test-status)\n- [How Can I Help?](#how-can-i-help)\n- [Contributing to OSHI](#contributing-to-oshi)\n- [Acknowledgments](#acknowledgments)\n- [License](#license)\n\nSupported Platforms\n---------------------------\n- Windows\n- macOS\n- Linux (Android)\n- UNIX (AIX, FreeBSD, OpenBSD, Solaris)\n\nDocumentation\n-------------\n* [API](https://oshi.github.io/oshi/oshi-core-java11/apidocs/) (javadocs)\n* [FAQ](src/site/markdown/FAQ.md)\n* [Change Log](CHANGELOG.md)\n* [Performance Considerations](src/site/markdown/Performance.md)\n* [Major Version Breaking Changes](src/site/markdown/Upgrading.md)\n* [Sample Output](src/site/markdown/SampleOutput.md)\n* [Applications and Projects using OSHI](src/site/resources/Projects.md)\n\nDownloads and Dependency Management\n-----------------------------------\nStable Release Version\n  * JDK8: [oshi-core-6.8.3](https://central.sonatype.com/artifact/com.github.oshi/oshi-core/6.8.3)\n  * JPMS: [oshi-core-java11-6.8.3](https://central.sonatype.com/artifact/com.github.oshi/oshi-core-java11/6.8.3)\n  * JDK6: [oshi-core-3.14.0](https://central.sonatype.com/artifact/com.github.oshi/oshi-core/3.14.0)\n\nCurrent Development (SNAPSHOT) downloads\n  * JDK8: [oshi-core-6.9.0-SNAPSHOT](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/github/oshi/oshi-core/6.9.0-SNAPSHOT)\n  * JPMS: [oshi-core-java11-6.9.0-SNAPSHOT](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/com/github/oshi/oshi-core-java11/6.9.0-SNAPSHOT/)\n\nOSHI Java 25+ Module\n----------------------------\nA new module, **`oshi-core-java25`**, is now available.\n\n- **Purpose:** This module intends to provide API-compatible implementations using the JDK Foreign Function \u0026 Memory (FFM) API, replacing JNA for native access over time with community contributions.\n- **Compatibility:**\n  - Compiles on **JDK 24+**.\n  - Will require **JDK 25+** at runtime once the full migration is complete.\n  - Initial support may be limited to operating systems with JDK 25 builds; broader OS support will follow as availability expands.\n- **Usage:**\n  - Use this dependency **in place of** `oshi-core`.\n  - Import oshi.SystemInfoFFM instead of oshi.SystemInfo as the entry-point.\n  - All other imports (oshi.hardware.*, oshi.software.os.*) remain unchanged.\n- **Status:**\n  - Some methods still delegate to legacy JNA-based internals until their FFM equivalents are implemented.\n\nUsage\n-----\n1. Include OSHI and its dependencies on your classpath.\n   - We strongly recommend you add `oshi-core` as a dependency to your project dependency manager such as Maven or Gradle.\n   - For Windows, consider the optional `jLibreHardwareMonitor` dependency if you need sensor information. Note the binary DLLs in this dependency are licensed under MPL 2.0.\n   - For Android, you'll need to add the [AAR artifact for JNA](https://github.com/java-native-access/jna/blob/master/www/FrequentlyAskedQuestions.md#jna-on-android) and exclude OSHI's transitive (JAR) dependency.\n   - See the [FAQ](https://github.com/oshi/oshi/blob/master/src/site/markdown/FAQ.md#how-do-i-resolve-jna-noclassdeffounderror-or-nosuchmethoderror-issues) if you encounter `NoClassDefFoundError` or `NoSuchMethodError` problems.\n2. Create a new instance of `SystemInfo`\n3. Use the getters from `SystemInfo` to access hardware or operating system components, such as:\n\n```java\nSystemInfo si = new SystemInfo();\nHardwareAbstractionLayer hal = si.getHardware();\nCentralProcessor cpu = hal.getProcessor();\n```\n\nSample Output\n-------------\n\nSee [SystemInfoTest.java](https://github.com/oshi/oshi/blob/master/oshi-core/src/test/java/oshi/SystemInfoTest.java) for examples. To see sample output for your machine:\n```sh\ngit clone https://github.com/oshi/oshi.git \u0026\u0026 cd oshi\n\n./mvnw test-compile -pl oshi-core exec:java \\\n  -Dexec.mainClass=\"oshi.SystemInfoTest\" \\\n  -Dexec.classpathScope=\"test\"\n```\n\nSome settings are configurable in the [`oshi.properties`](https://github.com/oshi/oshi/blob/master/oshi-core/src/main/resources/oshi.properties) file, which may also be manipulated using the [`GlobalConfig`](https://oshi.github.io/oshi/oshi-core/apidocs/oshi/util/GlobalConfig.html) class or using Java System Properties. This should be done at startup, as configuration is not thread-safe and OSHI does not guarantee re-reading the configuration during operation.\n\nThe `oshi-demo` artifact includes [several proof-of-concept examples](https://github.com/oshi/oshi/blob/master/oshi-demo/src/main/java/oshi/demo/) of using OSHI to obtain information, including a basic Swing GUI.\n\nYou can run some of the demos using `jbang`:\n\n```sh\n# list all the aliases\njbang alias list oshi/oshi\n\n# run the json demo\njbang json@oshi/oshi\n\n#run the gui\njbang gui@oshi/oshi\n```\n\nSupported Features\n------------------\n* Computer System and firmware, baseboard\n* Operating System and Version/Build\n* Physical (core) and Logical (hyperthreaded) CPUs, processor groups, NUMA nodes\n* System and per-processor load, usage tick counters, interrupts, uptime\n* Process uptime, CPU, memory usage, user/group, command line args, thread details\n* Physical and virtual memory used/available\n* Mounted filesystems (type, usable and total space, options, reads and writes)\n* Disk drives (model, serial, size, reads and writes) and partitions\n* Network interfaces (IPs, bandwidth in/out), network parameters, TCP/UDP statistics\n* Battery state (% capacity, time remaining, power usage stats)\n* USB Devices\n* Connected displays (with EDID info), graphics and audio cards\n* Sensors (temperature, fan speeds, voltage) on some hardware\n\nSupport\n-------\n* For bug reports, feature requests, or general questions about OSHI's longer term plans, please [create an issue](https://github.com/oshi/oshi/issues).\n* For help integrating OSHI into your own project or maintainer code review of your PRs, tag `@dbwiddis` in issues or pull requests on your project site.\n* For \"how to\" questions regarding the use of the API, consult examples in the `oshi-demo` project, create an issue, or [search on Stack Overflow](https://stackoverflow.com/search?q=%5Boshi%5D+is%3Aquestion) using the `oshi` tag, asking a new question if it hasn't been answered before.\n* To say thanks to OSHI's primary maintainer, you can [sponsor him](https://github.com/sponsors/dbwiddis) or [buy him a coffee](https://www.buymeacoffee.com/dbwiddis).\n\nOSHI for Enterprise\n-------------------\nAvailable as part of the Tidelift Subscription [![Tidelift](https://tidelift.com/badges/package/maven/com.github.oshi:oshi-core)](https://tidelift.com/subscription/pkg/maven-com-github-oshi-oshi-core?utm_source=maven-com-github-oshi-oshi-core\u0026utm_medium=referral\u0026utm_campaign=readme)\n\nThe maintainers of OSHI and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/maven-com-github-oshi-oshi-core?utm_source=maven-com-github-oshi-oshi-core\u0026utm_medium=referral\u0026utm_campaign=readme)\n\nSecurity Contact Information\n----------------------------\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure.\n\nContinuous Integration Test Status\n----------------------------------\n[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/v489i8xoyfspxx7s?svg=true)](https://ci.appveyor.com/project/dbwiddis/oshi)\n[![Cirrus Build Status](https://api.cirrus-ci.com/github/oshi/oshi.svg)](https://cirrus-ci.com/github/oshi/oshi)\n[![Windows CI](https://github.com/oshi/oshi/workflows/Windows%20CI/badge.svg)](https://github.com/oshi/oshi/actions?query=workflow%3A%22Windows+CI%22)\n[![macOS CI](https://github.com/oshi/oshi/workflows/macOS%20CI/badge.svg)](https://github.com/oshi/oshi/actions?query=workflow%3A%22macOS+CI%22)\n[![Linux CI](https://github.com/oshi/oshi/workflows/Linux%20CI/badge.svg)](https://github.com/oshi/oshi/actions?query=workflow%3A%22Linux+CI%22)\n[![Unix CI](https://github.com/oshi/oshi/workflows/Unix%20CI/badge.svg)](https://github.com/oshi/oshi/actions?query=workflow%3A%22Unix+CI%22)\n[![SonarQube Bugs](https://sonarcloud.io/api/project_badges/measure?project=oshi_oshi\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=oshi_oshi)\n[![SonarQube Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=oshi_oshi\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=oshi_oshi)\n[![SonarQube Maintainability](https://sonarcloud.io/api/project_badges/measure?project=oshi_oshi\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=oshi_oshi)\n[![SonarQube Reliability](https://sonarcloud.io/api/project_badges/measure?project=oshi_oshi\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=oshi_oshi)\n[![SonarQube Security](https://sonarcloud.io/api/project_badges/measure?project=oshi_oshi\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=oshi_oshi)\n[![Coverity Scan Build Status](https://img.shields.io/coverity/scan/28367.svg)](https://scan.coverity.com/projects/oshi-oshi)\n[![Codacy Grade](https://app.codacy.com/project/badge/Grade/4002c92342814fe1989a7841d9f427f1)](https://www.codacy.com/gh/oshi/oshi/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=oshi/oshi\u0026amp;utm_campaign=Badge_Grade)\n[![CodeQL](https://github.com/oshi/oshi/workflows/CodeQL/badge.svg)](https://github.com/oshi/oshi/security/code-scanning)\n[![Coverage Status](https://codecov.io/github/oshi/oshi/graph/badge.svg?token=XpNPRyv8TJ)](https://codecov.io/github/oshi/oshi)\n\nHow Can I Help?\n---------------\n[OSHI originated](https://code.dblock.org/2010/06/23/introducing-oshi-operating-system-and-hardware-information-java.html)\nas a platform-independent library that did not require additional software and had a license compatible with\nboth open source and commercial products. We have developed a strong core of features on major Operating Systems,\nbut we would love for *you* to help by:\n* Testing!  Our CI testing is limited to a few platforms.  Download and test the program on various operating systems/versions and hardware and help identify gaps that our limited development and testing may have missed. Specific high priority testing needs include:\n  * Windows systems with over 64 logical processors\n  * Raspberry Pi\n  * Less common Linux distributions\n* Contributing code.  See something that's not working right or could work better?  Help us fix it!  New contributors are welcome.\n* Documenting implementation.  Our Wiki is sparse and the `oshi-demo` artifact is a place to host proof-of-concept ideas.  Want to help new users follow in your footsteps?\n* Suggesting new features.  Do you need OSHI to do something it doesn't currently do?  Let us know.\n\nContributing to OSHI\n--------------------\n* [How to Contribute](src/site/markdown/Contributing.md)\n* [How to Release](src/site/markdown/Releasing.md)\n\nAcknowledgments\n---------------\nMany thanks to the following companies for providing free support of Open Source projects including OSHI:\n* [SonarCloud](https://sonarcloud.io/about) for a range of code quality tools\n* [GitHub Actions](https://github.com/features/actions), [AppVeyor](https://www.appveyor.com/), and [Cirrus CI](https://cirrus-ci.org/) for continuous integration testing\n* The [jProfile Java Profiler](https://www.ej-technologies.com/products/jprofiler/overview.html) used to eliminate CPU bottlenecks\n\nLicense\n-------\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":["https://github.com/sponsors/dbwiddis","https://github.com/sponsors/dblock","https://tidelift.com/funding/github/maven/com.github.oshi:oshi-core","https://www.buymeacoffee.com/dbwiddis","https://tidelift.com/badges/package/maven/com.github.oshi:oshi-core","https://tidelift.com/subscription/pkg/maven-com-github-oshi-oshi-core?utm_source=maven-com-github-oshi-oshi-core\u0026utm_medium=referral\u0026utm_campaign=readme","https://tidelift.com/security"],"categories":["Java","后端开发框架及项目","信息搜集"],"sub_categories":["JAVA开发"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foshi%2Foshi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foshi%2Foshi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foshi%2Foshi/lists"}