Browse Source

Merge pull request #424 from andrewflbarnes/docs/installation-steps

Correct install steps so shell config is separate from source install
pull/429/head
Barnesly 2 years ago committed by GitHub
parent
commit
6411c81d93
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 39
      README.md

39
README.md

@ -48,6 +48,13 @@ Alternatively, and on Linux, you can install it from source :
```bash ```bash
git clone https://github.com/jenv/jenv.git ~/.jenv git clone https://github.com/jenv/jenv.git ~/.jenv
```
#### 1.2 Configuring your shell
jEnv needs to be intialised in your shell by evalling the output of `jenv init -`. e.g.
```bash
# Shell: bash # Shell: bash
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(jenv init -)"' >> ~/.bash_profile echo 'eval "$(jenv init -)"' >> ~/.bash_profile
@ -56,9 +63,20 @@ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc echo 'eval "$(jenv init -)"' >> ~/.zshrc
``` ```
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. 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 ```bash
$ jenv doctor $ jenv doctor
@ -69,20 +87,11 @@ $ jenv doctor
[OK] Jenv is correctly loaded [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. 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.
To have `JAVA_HOME` get set by jEnv, enable the `export` plugin:
```bash
jenv enable-plugin export
exec $SHELL -l
```
Problem? Please visit the [Trouble Shooting](https://github.com/jenv/jenv/wiki/Trouble-Shooting) Wiki page. 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: **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:
@ -92,7 +101,7 @@ echo 'status --is-interactive; and jenv init - | source' >> ~/.config/fish/confi
cp ~/.jenv/fish/jenv.fish ~/.config/fish/functions/jenv.fish cp ~/.jenv/fish/jenv.fish ~/.config/fish/functions/jenv.fish
``` ```
#### 1.2 Adding Your Java Environment #### 1.3 Adding Your Java Environment
Use `jenv add` to inform `jenv` where your Java environment is located. `jenv` does not, by itself, install Java. 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
rm .java-version 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: 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
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. 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: Use `jenv shell VERSION` to set the Java used in this particular shell session:

Loading…
Cancel
Save