forked from pvr03/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava-install.sh
More file actions
40 lines (19 loc) · 772 Bytes
/
java-install.sh
File metadata and controls
40 lines (19 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
### check existing java version
java -version
## For installing OpenJDK 11 in Ubuntu
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install openjdk-11-jdk
### Alternatively, if you need JRE only then
sudo apt-get install openjdk-11-jre
### *************
### Run below commands to install Java 11 on Amazon Linux:
sudo amazon-linux-extras install java-openjdk11
### Run below commands to install Java 8 on Amazon Linux:
sudo yum install java-1.8.0-openjdk
sudo alternatives --config java
### check which java version acting
java -version
### if its not the one you installed then run the below command to set the java version.
sudo sudo update-alternatives --config java
### if you want to uninstall existing java
sudo yum remove java