jenv doesnt allow me to set the enable the plugins. I'm getting the following error:
$ jenv enable-plugin sbt
jenv: no such command `enable-plugin'
although it is listed as a valid command in the list of available commands
$ jenv commands
...
disable-plugin
...
enable-plugin
...
You may want to specify your version and your machine OS.
Same issue. OSX 10.11.4
Same issue. Ubuntu 16.04, jenv 0.4.3-14-g15104a3
I have the same issue on mac os x when running an ansible script.
It does not happen when running manually from the terminal.
jenv doctor says:
[OK] No JAVA_HOME set
[OK] Java binaries in path are jenv shims
[OK] Jenv is correctly loaded
jenv commands list 'enable-plugin' and 'disable-plugin'
Indeed, I've never tested in a tools like ansible.
To work in a interactive shell, you have to add :
eval "$(jenv init -)"
in you .bashrc / .zshrc
Maybe, this line is never executed in a ansible scope.
You are right!
This task will now work:
- name: enable jenv plugins
shell: eval "$(jenv init -)" && jenv enable-plugin {{ item }}
with_items: "{{ jenv_plugins }}"
Many thanks.
Most helpful comment
Indeed, I've never tested in a tools like ansible.
To work in a interactive shell, you have to add :
eval "$(jenv init -)"
in you .bashrc / .zshrc
Maybe, this line is never executed in a ansible scope.