{"id":18026758,"url":"https://github.com/yegor256/jhome","last_synced_at":"2025-08-25T08:12:40.030Z","repository":{"id":208259959,"uuid":"721178788","full_name":"yegor256/jhome","owner":"yegor256","description":"Get JAVA_HOME from Java, even if it's not set","archived":false,"fork":false,"pushed_at":"2025-03-17T15:13:46.000Z","size":172,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T21:06:35.941Z","etag":null,"topics":["java","java-home"],"latest_commit_sha":null,"homepage":"","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/yegor256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-11-20T14:15:37.000Z","updated_at":"2025-03-10T12:58:35.000Z","dependencies_parsed_at":"2023-11-20T16:28:13.110Z","dependency_job_id":"92f62412-75eb-4d50-b8b1-3102fd8988e8","html_url":"https://github.com/yegor256/jhome","commit_stats":null,"previous_names":["yegor256/jhome"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjhome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjhome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjhome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjhome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/jhome/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245764689,"owners_count":20668461,"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":["java","java-home"],"created_at":"2024-10-30T08:07:55.129Z","updated_at":"2025-08-25T08:12:39.981Z","avatar_url":"https://github.com/yegor256.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Finds Absolute Path of JAVA_HOME in Runtime\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/jhome)](https://www.rultor.com/p/yegor256/jhome)\n[![We recommend IntelliJ IDEA](https://www.elegantobjects.org/intellij-idea.svg)](https://www.jetbrains.com/idea/)\n\n[![mvn](https://github.com/yegor256/jhome/actions/workflows/mvn.yml/badge.svg)](https://github.com/yegor256/jhome/actions/workflows/mvn.yml)\n[![PDD status](https://www.0pdd.com/svg?name=yegor256/jhome)](https://www.0pdd.com/p?name=yegor256/jhome)\n[![Maven Central](https://img.shields.io/maven-central/v/com.yegor256/jhome.svg)](https://maven-badges.herokuapp.com/maven-central/com.yegor256/jhome)\n[![Javadoc](https://www.javadoc.io/badge/com.yegor256/jhome.svg)](https://www.javadoc.io/doc/com.yegor256/jhome)\n[![codecov](https://codecov.io/gh/yegor256/jhome/branch/master/graph/badge.svg)](https://codecov.io/gh/yegor256/jhome)\n[![Hits-of-Code](https://hitsofcode.com/github/yegor256/jhome)](https://hitsofcode.com/view/github/yegor256/jhome)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/jhome/blob/master/LICENSE.txt)\n\nIn your Java application you may want to run another Java application.\nIn order to do this, you need to know where is the `bin/java` executable.\nIt's in the `JAVA_HOME` (environment variable), which is not always set.\nInstead of looking for this place manually, just use this small one-class\nlibrary.\n\nFirst, you add this to your `pom.xml`:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.yegor256\u003c/groupId\u003e\n  \u003cartifactId\u003ejhome\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThen, you use it like this:\n\n```java\nimport com.yegor256.jhome;\nPath p = new Jhome().path(\"bin/java\");\n```\n\nThe result is the location of `bin/java` inside `JAVA_HOME`.\nAlso, you can use `java()` and `javac()` methods in order to get the full path\nto `java` and `javac` executables respectively:\n\n```java\nimport com.yegor256.jhome;\nPath java = new Jhome().java();\nPath javac = new Jhome().javac();\n```\n\n## How to Contribute\n\nFork repository, make changes, send us\na [pull request](https://www.yegor256.com/2014/04/15/github-guidelines.html).\nWe will review your changes and apply them to the `master` branch shortly,\nprovided they don't violate our quality standards. To avoid frustration,\nbefore sending us your pull request please run full Maven build:\n\n```bash\nmvn clean install -Pqulice\n```\n\nYou will need Maven 3.3+ and Java 8+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjhome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Fjhome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjhome/lists"}