@ -48,6 +48,13 @@ Alternatively, and on Linux, you can install it from source :
@@ -48,6 +48,13 @@ Alternatively, and on Linux, you can install it from source :
To have `JAVA_HOME` get set by jEnv, enable the `export` plugin. This needs to be done in an initialised shell:
```bash
eval "$(jenv init -)"
jenv enable-plugin export
```
Restart your shell by closing and reopening your terminal window or running `exec $SHELL -l` in the current session for the changes to take effect.
To verify `jenv` was installed, run `jenv doctor`. On a macOS machine, you'll observe the following output:
```bash
exec $SHELL -l
```
To verify `jenv` was installed and initialised, run `jenv doctor`. On a macOS machine, you'll observe the following output:
```bash
$ jenv doctor
@ -69,20 +87,11 @@ $ jenv doctor
@@ -69,20 +87,11 @@ $ jenv doctor
[OK] Jenv is correctly loaded
```
Observe that `jenv` is correctly loaded but Java is not yet installed. To rememedy this, see "[Adding Your Java Environment](#12-adding-your-java-environment)" below.
To have `JAVA_HOME` get set by jEnv, enable the `export` plugin:
```bash
jenv enable-plugin export
exec $SHELL -l
```
Observe that `jenv` is correctly loaded but Java is not yet installed. To rememedy this, see "[Adding Your Java Environment](#13-adding-your-java-environment)" below.
Problem? Please visit the [Trouble Shooting](https://github.com/jenv/jenv/wiki/Trouble-Shooting) Wiki page.
Continue to the next section to install java.
##### Support for fish
**Untested**: While this fork has improved `fish` shell support, it has not been tested by this maintainer. To install `jenv` for Fish according to the contributor's instructions:
Use `jenv add` to inform `jenv` where your Java environment is located. `jenv` does not, by itself, install Java.
@ -141,7 +150,7 @@ If you executed this commands inside your `$HOME` directory, you can now delete
@@ -141,7 +150,7 @@ If you executed this commands inside your `$HOME` directory, you can now delete
rm .java-version
```
#### 1.3 Setting a Global Java Version
#### 1.4 Setting a Global Java Version
Use `jenv global VERSION` to set a global Java version:
@ -154,7 +163,7 @@ When you next open a shell or terminal window, this version of Java will be the
@@ -154,7 +163,7 @@ When you next open a shell or terminal window, this version of Java will be the
On macOS, this sets `JAVA_HOME` for GUI applications on macOS using `jenv macos-javahome`. Integrates [this tutorial](https://www.ibm.com/support/knowledgecenter/en/SSPJLC_7.6.2/com.ibm.si.mpl.doc/tshoot/ts_java_home.html) to create a file that does **not update dynamically** depending on what local or shell version of Java is set, only global.
#### 1.4 Setting a Shell Java Version
#### 1.5 Setting a Shell Java Version
Use `jenv shell VERSION` to set the Java used in this particular shell session: