jenv In the field development, I got the opportunity to use multiple versions of Java, so I organized the method to use while switching.
Since it is published on GitHub, bring it and set it.
$ git clone https://github.com/gcuisinier/jenv.git ~/.jenv
$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(jenv init -)"' >> ~/.bash_profile
Please install Java in advance. Register the Java home directory with add.
$ jenv add /usr/lib/jvm/java-11-openjdk-amd64
$ jenv add /opt/jdk1.7.0_80/
$ jenv versions
system
* 1.7 (set by /home/hogehoge/.jenv/version)
1.7.0.80
11.0
11.0.3
openjdk64-11.0.3
oracle64-1.7.0.80
$ jenv global oracle64-1.7.0.80
$ mkdir java7
$ cd java7
$ jenv local oracle64-1.7.0.80
This will change the Java version only under java7
Recommended Posts