I was using Bash as my default shell on macOS but I decided to switch to Fish.
I am trying to switch between different versions of Java. In bash it was done using the ~/.bash_profile
export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
I have set the equivalent on Fish ~/.config/fish/fish_variables
set -x JAVA_HOME `/usr/libexec/java_home -v 1.7`
Unfortunately, Java version is not being changed. How can I set environment variables (specific version of Java, in particular) using ~/.config/fish/fish_variables
?
UPDATE:
According to the FAQ, instead of ~/.config/fish/fish_variables
, ~/.config/fish/config.fish
should be used. Also I created ~/.config/fish/fish.config
instead of ~/.config/fish/config.fish
.
echo hello
in that file and start a new fish shell do you see the word "hello"?