joplin-notes/joplin notion extension/Web Development/Java/jenv.md
2026-11-04 00:33:23 +05:30

29 lines
No EOL
801 B
Markdown

jenv
https://github.com/jenv/jenv
https://www.youtube.com/watch?v=9FVZyeFDXo0
its a java version manager like nvm which alters the environment path
- Installation
```bash
git clone https://github.com/jenv/jenv.git ~/.jenv
# Shell: bash
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile
# Shell: zsh
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc
```
Here instead of `~/.bash_profile` it can be `~/.bashrc` too
- Configurations
Check installed versons using `jenv versions` .
To add java to jenv use
`jenv add /usr/lib/jvm/java-11-openjdk`
- Using
To set version locally for current directory
`jenv local 11.0.2`
For globally
`jenv global 11.0.2`