{"id":16175706,"url":"https://github.com/osiris-team/jprocesses2","last_synced_at":"2025-03-19T00:31:24.203Z","repository":{"id":110533278,"uuid":"466535526","full_name":"Osiris-Team/jProcesses2","owner":"Osiris-Team","description":"Get cross-platform process details in Java. Also runs on Java 7 and 8.","archived":false,"fork":false,"pushed_at":"2022-07-16T20:19:13.000Z","size":145,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T01:21:24.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Osiris-Team.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2022-03-05T18:25:58.000Z","updated_at":"2024-03-31T14:25:38.000Z","dependencies_parsed_at":"2023-04-10T15:48:14.114Z","dependency_job_id":null,"html_url":"https://github.com/Osiris-Team/jProcesses2","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FjProcesses2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FjProcesses2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FjProcesses2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osiris-Team%2FjProcesses2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Osiris-Team","download_url":"https://codeload.github.com/Osiris-Team/jProcesses2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244331810,"owners_count":20436010,"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":[],"created_at":"2024-10-10T04:45:34.319Z","updated_at":"2025-03-19T00:31:24.198Z","avatar_url":"https://github.com/Osiris-Team.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jProcesses2 [![](https://jitpack.io/v/Osiris-Team/jProcesses2.svg)](https://jitpack.io/#Osiris-Team/jProcesses2)\nFork of [JProcesses](https://github.com/profesorfalken/jProcesses) with additional features and enhancements. Get cross-platform process details in Java.\nAdd this as dependency to your project via [Maven/Gradle/Sbt/Leinigen](https://jitpack.io/#Osiris-Team/jProcesses2/LATEST) (requires Java 7 or higher).\n\n### Features\n- Similar to the [Java 9 Process API](https://docs.oracle.com/javase/9/docs/api/java/lang/Process.html), but provides more process details and also runs on Java 7 and 8.\n- Parent/child process details and easy cross-plaftform processes priority changing.\n- Easy access to the currently running JVM process.\n```java\nclass Example{\n    public static void main(String[] args) {\n        ProcessUtils processUtils = new ProcessUtils();\n        List\u003cJProcess\u003e list = processUtils.getProcesses();\n        for (JProcess process : list) {\n            // Collect process details:\n            System.out.println(process.name);\n            System.out.println(process.pid);\n            System.out.println(process.command);\n            System.out.println(process.usedMemoryInKB);\n            // etc...\n\n            // Parent/Child processes:\n            JProcess parent = process.parentProcess;\n            List\u003cJProcess\u003e childProcesses = process.childProcesses;\n\n            // Cross-platform priorities and timestamps: \n            JProcessPriority priority = process.getPriority();\n            Date timestampStart = process.getTimestampStart();\n\n            // Interact with the process:\n            //process.changePriority(JProcessPriority.REAL_TIME);\n            //process.stop();\n            //process.kill();\n            // Commented just in case you want to run this code.\n        }\n\n        // Easy access to the running JVM process:\n        JProcess thisProcess = processUtils.getThisProcess(list);\n\n        // Print parent/child processes in a tree:\n        processUtils.printTree(list);\n    }\n}\n```\n### CMDTool\nYou can also use this as command line tool, by downloading the jar from the latest release.\nand running it with `java -jar jP2.jar`.\n```java\nout.println(\"Available commands:\");\nout.println(\"help | Prints all available commands. (Shortcut: h)\");\nout.println(\"exit | Exit the jProcess2 command line tool. (e)\");\nout.println(\"fetch | Fetches all currently running processes details. (f)\");\nout.println(\"print | Prints a list with all processes details. (p)\");\nout.println(\"print tree | Prints a list with all processes details but also their parent/child relations. (pt)\");\n```\nIt's also possible to run a command directly, without entering the REPL like so\nfor example: `java -jar jP2.jar print`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosiris-team%2Fjprocesses2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosiris-team%2Fjprocesses2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosiris-team%2Fjprocesses2/lists"}