Skip to content
Snippets Groups Projects
Commit 07c68d2e authored by George Adrian Stoica's avatar George Adrian Stoica
Browse files

added screenshots for linux and mac

added more info for installing other types of binaries
parent 48eeb483
No related branches found
No related tags found
No related merge requests found
Pipeline #47099 passed
......@@ -83,6 +83,9 @@ Open a terminal window and type
java -version
```
![](images/linux03_check_false.png)
#### Extract downloaded binary
After the download finishes you have in the destination folder the `.tar.gz` file with a name like this `openjdk-12.0.2_linux-x64_bin.tar.gz` .
......@@ -96,6 +99,11 @@ sudo mkdir /usr/lib/jvm
sudo mv jdk-12.0.2 /usr/lib/jvm/
```
![](images/linux02_extract.png)
![](images/linux04_move.png)
#### Set up the environment variables
create a shell script in /etc/profile.d
......@@ -104,6 +112,9 @@ create a shell script in /etc/profile.d
sudo nano /etc/profile.d/jdk.sh
```
![](images/linux05_env01.png)
add the following lines inside the file and save and close
``` bash
......@@ -112,6 +123,8 @@ export PATH=$PATH:$JAVA_HOME/bin
```
![](images/linux06_env02.png)
apply changes
logout and log back in or run the script you have just created
......@@ -128,7 +141,7 @@ echo $JAVA_HOME
java -version
```
![](images/linux07_check_true.png)
### MacOs
......@@ -140,6 +153,9 @@ Open a terminal window and type
java -version
```
![](images/mac_02_check_false.png)
#### Extract downloaded binary
After the download finishes you have in the destination folder the `.tar.gz` file with a name like this `openjdk-12.0.2_osx-x64_bin.tar.gz`.
......@@ -150,13 +166,18 @@ Extract the files using the following command
tar xf openjdk-12.0.2_osx-x64_bin.tar.gz
```
![](images/mac_03_extract.png)
Move the extracted to the folder `/Library/Java/JavaVirtualMachines/`
You will need to execute the move with super user privileges in order to put the files in the system folder
``` bash
sudo mv jdk-12.0.2 /Library/Java/JavaVirtualMachines/
sudo mv jdk-12.0.2.jdk /Library/Java/JavaVirtualMachines/
```
![](images/mac_04_move.png)
#### Set up the environment variables
......@@ -168,22 +189,42 @@ If the file mentioned does not exist we can create it with the following command
touch ~/.bash_profile
```
![](images/mac_05_env01.png)
We need to export the `JAVA_HOME` variable so we edit the file using
``` bash
edit ~/.bash_profile
```
or
``` bash
nano ~/.bash_profile
```
![](images/mac_06_env02.png)
we add the following line
`export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-12.0.2/Contents/Home"`
![](images/mac_08_env03.png)
finally we save the changes and close the file. To apply the changes we need to run the following command
``` bash
source ~/.bash_profile
```
![](images/mac_07_apply_env.png)
check if everything is in order
![](images/mac_09_check_true.png)
## Using sdkman
......@@ -265,3 +306,25 @@ See more commands on the sdkman.io site
4. download the binary corresponding to your operating system
There are more choices for downloads. Typically a .zip or .tar.gz would imply manual setup while the .exe, .deb, .rpm, .dmg will provide some sort of installer support.
For the .zip or .tar.gz files you need to follow the procedure from above.
.exe (windows) - run and follow the installer prompts
.dmg (mac) - run and follow the installer prompts
.deb (linux) - package format used in Debian and Ubuntu linux distributions
```bash
sudo dpkg -i ~/Downloads/jdk-12.0.2_linux-x64_bin.deb
```
alternative way to install .deb packages is with apt
```bash
sudo apt install ~/Downloads/jdk-12.0.2_linux-x64_bin.deb
```
In Ubuntu you can also double click the package and it will open in Software Center where there is an option to install it.
.rpm (linux) - package format commonly used in Redhat and Mandrake linux distributions
``` bash
rpm -ivh ~/Downloads/jdk-12.0.2_linux-x64_bin.rpm
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment