{"id":13765542,"url":"https://github.com/linux-china/jenv","last_synced_at":"2025-04-05T04:12:13.942Z","repository":{"id":6837371,"uuid":"8085806","full_name":"linux-china/jenv","owner":"linux-china","description":"Java enVironment Manager  ","archived":false,"fork":false,"pushed_at":"2020-03-31T21:34:22.000Z","size":627,"stargazers_count":604,"open_issues_count":28,"forks_count":82,"subscribers_count":76,"default_branch":"master","last_synced_at":"2025-03-29T03:07:43.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://jenv.io","language":"Shell","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/linux-china.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}},"created_at":"2013-02-08T01:58:53.000Z","updated_at":"2025-02-08T07:40:04.000Z","dependencies_parsed_at":"2022-09-15T14:40:54.709Z","dependency_job_id":null,"html_url":"https://github.com/linux-china/jenv","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fjenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fjenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fjenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-china%2Fjenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-china","download_url":"https://codeload.github.com/linux-china/jenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284951,"owners_count":20913704,"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-08-03T16:00:40.976Z","updated_at":"2025-04-05T04:12:13.916Z","avatar_url":"https://github.com/linux-china.png","language":"Shell","readme":"jenv: the Java enVironment Manager\n=======================================\n\n[![Join the chat at https://gitter.im/linux-china/jenv](https://badges.gitter.im/linux-china/jenv.svg)](https://gitter.im/linux-china/jenv?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\njenv is a tool for managing parallel Versions of Java Development Kits on any system, such as Linux, Mac and Windows.\nIt provides a convenient command line interface for installing, switching, removing and listing candidates.\nIf you have any problem, please join gitter room: https://gitter.im/linux-china/jenv \n\n## Why jenv\n\n   * Easy to manage Java versions, such as 1.6, 1.7 and 1.8\n   * Easy to install Java related tools, such as ant, maven, tomcat etc.\n   * Easy to manage candidate versions. It supports installing new version, reinstalling or uninstalling old ones\n   * Directory is standard and friendly to IDE\n   * Easy to be extended - you can setup your own jenv in your company to manage development environment\n   * Easy to backup your env.\n   * Bash completion support. Use TAB to complete command name, candidate name and version\n   * Multi OS support, such as Mac, Linux and Windows(Cygwin)\n\n## Installat jenv\n\nOpen your favourite terminal and enter the following:\n```\n    $ curl -L -s get.jenv.mvnsearch.org | bash\n```\nIf the environment needs tweaking for jenv to be installed, the installer will prompt you accordingly and ask you to restart.\n\n## Install Java\nBecause I cannot redistribute Java SDK, so you should download it from http://www.oracle.com/technetwork/java/javase/downloads/index.html\nand install by yourself. After installation, please execute the following command:\n```\n    $ mkdir -p $HOME/.jenv/candidates/java\n    $ ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/home $HOME/.jenv/candidates/java/1.8.0_112\n    $ jenv default java 1.8.0_112\n```\nfor Mac user, after you install JDK from dmg file, please execute:\n\n   $ jenv install java 1.8.0_112 system\n\nand jenv will link the Java version automatically.\n\nYou can also install Java by http url:\n\n   $ jenv install java 1.8.0_112  http://xxxx.com/java/java-1.8.0_112.zip\n\n## Install candidates\n\nFirstly, view all available candidates:\n\n    $ jenv all\n\nSecondly, list available versions for the candidate, such as maven candidate:\n\n    $ jenv ls maven\n\nFinally, install the candidate with the specified version:\n\n    $ jenv install maven 3.5.3\n\nIn your terminal, type `mvn --version` to check the installation.\n\nIf you want to list all installed candidates, use the following command:\n\n    $ jenv ls\n\nFor Docker user, your can use silent mode in your Dockerfile as following:\n\n    $ JENV_AUTO=true; jenv install maven 3.5.3\n### Update repository\nThe candidate's versions are maintained in the central repository. To keep updated with central repository, please use:\n\n    $ jenv repo update\n\n### Clonable development environments with jenv\nYou can clone your jenv between multiple hosts.\n\n* clone your local jenv to remote host: `jenv clone user@remote-host`\n* clone your local candidate to remote host:  `jenv clone candidate version user@remote-host`\n* clone candidate from remote host: `jenv clone user@remote-host canidate version`\n\n## Other Commands\n\n  * `uninstall`: Uninstall the candidate with the version specified, such as `jenv uninstall maven 3.0.4`\n  * `reinstall`: Reinstall the candidate with the version specified, such as `jenv reinstall maven 3.0.5`\n  * `use`: Use the candidate with the version specified, such as `jenv use maven 3.0.4`\n  * `which`: Check which version for candidate\n  * `pause`: Pause candidate usage\n  * `exe`: Execute script under candidate, such as `jenv execute tomcat startup.sh` or `jenv execute tomee startup.sh`\n  * `default`: Make the version as default, such as `jenv default maven 3.0.4`\n  * `cd`: Change directory to candidate install directory, such as `jenv cd groovy`\n  * `show`: Display the candidate's detailed information\n  * `requirements`: Display jenv requirements\n\n## jenvrc support\njenvrc is jenv setup file which contains candidate and the version as following:\n```\njava=1.8.0_112\nmaven=3.5.3\n```\nAfter you enter this directory, jenv will setup environment automatically.\nNow You can use jenvrc to setup Java environment for each of your individual projects.\nYou can use jenv init to generate jenvrc file.\n\n      $jenv init\nNote:  Line started with # means line comment.\n\n### Script Hook\nAll the scripts are under candidate home and invoked by jenv automatically.\n\n* autorun.sh: executed to load current candidate \n* post-install.sh: executed after install\n* uninstall.sh: executed before uninstall\n\n## Install local candidates\nIf you want to add custom candidate into jenv, please create candidates_local under $HOME/.jenv/db/ directory and input candidate name.\n\n    $jenv add spike 0.0.1\n    $jenv install spike 0.0.1 git@github.com:linux-china/groovy_scripts.git\nThen you can install candidate from git repository, and you can update candidate by following command:\n\n    $jenv update spike\nIf the candidate is absent, jenv will update all git or svn based candidates.\n\n    $jenv update\nUpdate all git or svn based candidates.\n\n### jenv with Docker Executable Images\nIf you want to integrate jenv with Docker Executable Images, you can use following steps:\n\n* create a repository in github\n* create autorun.sh file to create functions for commands in Docker images:\n```\nmvn() {\n    docker run --rm \\\n              -v $(pwd):/project \\\n              -w /project \\\n              --entrypoint mvn \\\n              maven:3.5.0-jdk-8 $*\n}\n```\n\n* install candidate from github\n* execute shell functions in autorun.sh\n\n\n## How to update jenv\nPlease use selfupdate command to get last version and candidate repository.\n\n```\n   $ jenv selfupdate\n```\n## jenv IntelliJ IDEA plugin\nWith jenv IDEA plugin, you don't need to setup Java SDK, Maven, and so on, and jenv IDEA plugin can scan jenv directory\nand setup the settings in IDEA automatically. Please visit http://plugins.jetbrains.com/plugin/?idea\u0026pluginId=7229\n\n## Reference\n\n* Shell Code Style: http://google-styleguide.googlecode.com/svn/trunk/shell.xml\n\n### TODO\n\n* jenv outdated: display outdated candidates\n* broadcast: broadcast message","funding_links":[],"categories":["Shell (473)","Shell","Java环境管理","Version Managers"],"sub_categories":["Java"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fjenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-china%2Fjenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-china%2Fjenv/lists"}