Jenv: Fish plugin support

Created on 27 Feb 2015  ·  9Comments  ·  Source: jenv/jenv

I have had great success with jenv so far (all the version and add commands are spot on), so I thought I'd try out some plugins. I'm using fish and oh-my-fish. The jenv plugin is definitely loaded, as it's referenced in the error:

jenv enable-plugin maven                                                                                                                  
fish: Expected a command name, got token of type 'Run job in background'. Did you mean 'COMMAND; and COMMAND'? See the help section for the 'and' builtin command by typing 'help and'.
/Users/cm022291/.oh-my-fish/functions/jenv.fish (line 4): begin; echo maven plugin activated && jenv rehash
                                                                                              ^
in . (source) call of file '-',
    called on line 37 of file '/Users/cm022291/.oh-my-fish/functions/jenv.fish',

in function 'jenv',
    called on standard input,
    with parameter list 'enable-plugin maven'

source: Error while reading file '-'

I looked at the jenv.fish file, and I wasn't able to find && anywhere in it.

Most helpful comment

Using set -e JAVA_HOME ( jenv javahome ) does not work for me:

set: Values cannot be specfied with erase
~/.config/fish/config.fish (line 3):
set -e JAVA_HOME ( jenv javahome )
^
from sourcing file ~/.config/fish/config.fish
    called during startup

I had to use set -gx JAVA_HOME ( jenv javahome )

All 9 comments

Plugins are not "fish" ready, only implemented for bash. If I find the time, I'll write the maven one that I need too.

Any movement around this?

I had the same issue.
Did someone already fix that?

I fixed the maven problem by instead adding to config.fish set -e JAVA_HOME adding set JAVA_HOME ( jenv javahome )

Thanks, I had the same issue with using the export plugin in fish shell. The solution @Mazorius provided above works as a workaround.

I'm falling foul of using the maven plugin with fish. However I get a different error. I've tried @Mazorius solution but that didn't help...

screenshot 2018-05-12 19 32 51

I do not install the plugin, because of this issue.

I only add the line set -e JAVA_HOME ( jenv javahome ) to my fish.config.

Maybe I will also look into the scripts if I find some free time slot.

Using set -e JAVA_HOME ( jenv javahome ) does not work for me:

set: Values cannot be specfied with erase
~/.config/fish/config.fish (line 3):
set -e JAVA_HOME ( jenv javahome )
^
from sourcing file ~/.config/fish/config.fish
    called during startup

I had to use set -gx JAVA_HOME ( jenv javahome )

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rexgreen picture rexgreen  ·  8Comments

HeIsIdeus picture HeIsIdeus  ·  9Comments

haifzhan picture haifzhan  ·  3Comments

Tmarty picture Tmarty  ·  7Comments

iangregsondev picture iangregsondev  ·  8Comments