[Hadoop] Installing JDK and JRE for Hadoop

1 분 소요

How to Download JDK on Lunux?

How to Download JRE on Linux?

If you interested in the latest JDK version(i.e. 13 version), it could be hard for installing that jdk 13 version is not required JRE.
It should download TimeZone data.
So in this part, jdk 8 would easy to learning hadoop.

Installation of JRE and JDK on Linux:

  • Open up the terminal by pressing Ctrl + option(Alt) + T
  • Create a java folder at /usr/local/ using root permission. It will ask for the password for the Ubuntu system.
    $ sudo mkdir -p /usr/local/java
  • Now copy and paste the downloaded JDK and JRE tar.gz from the Download location to the newly created java directory.
    $ cd Download/
    $ sudo cp -r jre*.tar.g /usr/local/java
    $ sudo cp -r jdk*.tar.gz /usr/local/java
  • Now go to the java folder, then un-tar JDK and JRE
    $ cd /usr/local/java
    $ sudo tar xvzf jdk*.tar.gz
    $ sudo tar xvzf jre*.tar.gz
  • Now go to the /etc/profile and edit the profile using the lines metioned below.
  • Open /etc/profile using gedit:
    $ sudo gedit /etc/profile
  • Then write these lines into the profile document.

    export JAVA_HOME=/usr/local/java/jdk1.8.0_241
    PATH=$PATH:$JAVA_HOME/bin
    export JRE_HOME=/usr/local/java/jre1.8.0_241
    PATH=$PATH:$JRE_HOME/bin
    export PATH
  • Now wirte these lines onto the termianl one by one.
    sudo update-alternatives --install /usr/bin/java java /usr/local/java/jdk1.8.0_241/bin/java 2
    sudo update-alternatives --install /usr/bin/javac javac /usr/local/java/jdk1.8.0_241/bin/javac 2
    sudo update-alternatives --install /usr/bin/jar jar /usr/local/java/jdk1.8.0_241/bin/jar 2
  • Now write these lines onto the terminal one by one.
    sudo update-alternatives --set java /usr/local/java/jdk1.8.0_241/bin/java
    sudo update-alternatives --set javac /usr/local/java/jdk1.8.0_241/bin/javac
    sudo update-alternatives --set jar /usr/local/java/jdk1.8.0_241/bin/jar

    NOTE: If you are using the smae Java version, the given lines will work fine. For different versions you need to edit the version details in the lines.

  • Now refresh the profile to take up the changes we have done.
    $ . /etc/profile
  • Then please reboot your system.
    $ reboot
  • To check whether the java is installed correctly or not, paste the command in your terminal. If it returns the java version, then java is installed correctly.
    $ java -version

Thank you for visting my blog :D

댓글남기기