Skip to main content

Install Java 8 on CentOS 7

 

Reading Time: 2 minutes

In this tutorial, we’ll be showing you how to install Oracle’s Java 8 programming language specifically onto a CentOS 7 server. This simple object-oriented language is used for many of the applications and websites you come across today.  Let’s jump right in!

Pre-flight

  1. Open the terminal and login as root.  If you are logged in as another user, you will need to add sudo before each command.
  2. Working on a Linux CentOS 7 VPS server
  3. No installations of previous Java versions

Installing Java 8 on CentOS 7

Step 1: Update

As a matter of best practice we’ll update before installing any new programs:

yum -y update

Step 2: Install Java 8

yum install java-1.8.0-openjdk

Step 3:  Verify Java is Installed

java -version

Example Output:

java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Set Java’s Home Environment

Step 1: Find Java’s Path

Let’s set the JAVA_HOME variable, using the following command will give us a path so we can set the variable.

update-alternatives --config java

You’ll see a prompt to “Enter to keep the current selection[+], or type selection number:”, if you had multiple Java version you could set the default here, but all we need is the path of Java so we can exit pressing enter.  The highlighted area is the path we will need to copy/paste into our .bash_profile file.

Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java)</code?

Step 2: Setting Java’s Path in Your Environment

After copying your Java’s path, open the .bash_profile with your text editor.

vim .bash_profile

Export your Java path into the .bash_profile by adding the following to the bottom of the file. (Your path may look different from mine, and it’s not important that they vary.)

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java

Refresh the File:

Source .bash_profile

When you use the JAVA_HOME variable you’ll now be able to see the path you set.

echo $JAVA_HOME

Example Output:

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java




Comments

Popular posts from this blog

Introduction to Security Operations Center

                                                            Fig: Security Operations Center Keyword: Soc , Introduction: ডিজিটালাইজেশনের বিশ্বে, ডিজিটাল পণ্য মানুষের জীবনের একটি অবিচ্ছেদ্য অংশ হয়ে উঠেছে। ব্যবসায়িক পরিবেশে ডিজিটালাইজেশনের দ্রুত বৃদ্ধি অনিবার্যভাবে জনসাধারণের মনোযোগের জন্য চুম্বক হয়ে উঠেছে। ইন্টারনেটের বর্ধিত ব্যবহারের সাথে, প্রতিটি ব্যবসা প্রতিষ্ঠান তার দর্শকদের কাছে পৌঁছানোর মাধ্যম হিসাবে ইন্টারনেট ব্যবহার করে।  আর ইন্টারনেট দুনিয়া কখনোই হ্যাকারদের হাত থেকে মুক্ত নয়। একটি ব্যবসায়িক সংস্থার পথে আসা সবচেয়ে বড় চ্যালেঞ্জগুলির মধ্যে একটি হল কীভাবে অনলাইন কার্যক্রম সুচারুভাবে পরিচালনা করা যায়। কিভাবে তাদের কম্পিউটার নেটওয়ার্ক হ্যাক থেকে নিরাপদ রাখা? এছাড়াও, দ্রুত ক্লাউড গ্রহণের নিজস্ব ঝুঁকি এবং নিরাপত্তা বাধার জটিলতা রয়েছে। Definition: একটি সিকিউরিটি অপারেশন সেন্টার (SOC) হল একটি  সিস্টেম   মধ্যে একটি...

Wazuh platform components and architecture

In the article   provides an overview of the Wazuh platform components and architecture. It also includes a brief description of some of the most common use cases of the solution. IDS: Intrusion Detection System  (IDS) কি? Intrusion Detection System (IDS) হল একটি software বা hardwareযা চলমান আক্রমণ, লঙ্ঘন এবং দুর্বলতা যেমন সোশ্যাল ইঞ্জিনিয়ারিং অ্যাসাল্টের পাশাপাশি ম্যালওয়্যার শনাক্ত করে এবং তারপরে system সতর্ক করে। Components: 1.Components 2.Architecture 3.Use cases 1.Components: Components Wazuh প্ল্যাটফর্ম আপনার ক্লাউড, কন্টেইনার এবং সার্ভার ওয়ার্কলোডগুলিকে রক্ষা করার জন্য বৈশিষ্ট্যগুলি প্রদান করে৷ এর মধ্যে রয়েছে লগ ডেটা বিশ্লেষণ, অনুপ্রবেশ এবং ম্যালওয়্যার সনাক্তকরণ, ফাইল অখণ্ডতা পর্যবেক্ষণ, কনফিগারেশন মূল্যায়ন, দুর্বলতা সনাক্তকরণ এবং নিয়ন্ত্রক সম্মতির জন্য সমর্থন। ওয়াজুহ সমাধান নিম্নলিখিত তিনটি উপাদানের উপর ভিত্তি করে: Wazuh agent : ইহা সেটআপ মার্ধমে সমাধান করে থাকে laptops, desktops, servers, cloud instances or virtual machines, it provides prevention, de...

what is wazuh ? Hands-on Wazuh Host-based Intrusion Detection System (HIDS) Deployment .

Wazuh is a free and open source platform used for threat prevention, detection, and response. It protects workloads across on-premises, virtualized, containerized and cloud-based environments. Wazuh is widely used by thousands of organizations around the world, from small businesses to large enterprises. Wazuh solution consists of an  endpoint security agent , deployed to the monitored systems, and a  management server , which collects and analyzes data gathered by the agents. Besides, Wazuh has been fully integrated with the  Elastic Stack , providing a search engine and data visualization tool that allows users to navigate through their security alerts. Hi Peerlysters, In this article we are going to learn how to deploy a powerful HIDS called "Wazuh" Image Source What is an intrusion detection system? Intrusion detection systems are a set of devices or pieces of software that play a huge role in modern organizations to defend against intrusions and malicious activities....