Install Java on EC2

So in the previous tutorial we’ve seen What is DevOps, DevOps Lifecycle, Chef cookbook recipe. In this post we will be seeing how we can Install Java on our EC2 instance.

So let’s get started! Prerequisite of this tutorial is you should have AWS Account free tier will work.

Step 1: Open AWS EC2 instance and launch new instance RedHat Enterprise Linux and add Security Group with Port 8080 open for internet.

Server
Security Group

Step 2: You can see the server is started, connect to your terminal/console from your workstation system.

Initialized server

Now click on connect and connect using your key.

Step 3: Now you’re connected, first we will be installing Java and then will be installing Jenkins

Connection

Step 4: Install Java using below command

$yum install java-1.8*

Verify the installation and java version using and set the path variable of Java

java -version 
find /usr/lib/jvm/java-1.8* | head -n 3
$ vi .bash_profile 
#JAVA_HOME=
export JAVA_HOME
PATH=$PATH:$JAVA_HOME
# To set it permanently update your .bash_profile
source ~/.bash_profile

And you’re done! Congratulations you’ve successfully Installed Java on your EC2 instance and updated the path variable.



Categories: AWS, DevOps, JAVA

Tags: , , , , , , , ,

1 reply

Trackbacks

  1. Install Jenkins on AWS EC2 Instance – THE NUCLEAR GEEKS

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: