Skip to main content

Install Oracle JDK and declaring path in Linux Operating System (Ubuntu 18.04)

We can install oracle jdk at any Linux operating systems. Firstly We need updated oracle jdk. We collect this from Oracle site. Now We can not directly download jdk without sign in account. So, Firstly We create a fresh account in oracle site. Then Download Oracle JDK for Linux 64bit version.Now Extract it...
tar -zxvf jdk-8u211-linux-x64.tar.gz
Create a new folder in /usr/lib directory. Then move this file it.
sudo mv jdk1.8.0_211/ /usr/lib/java
Now Update java alternative these command...
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/java/jdk1.7.0_65/bin/java" 1
 
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/java/jdk1.7.0_65/bin/javac" 1

sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/java/jdk1.7.0_65/bin/javaws" 1

Now update ~/,barchrc file. Command..
sudo gedit ~/.bashrc
And past this command in this file...
##add these 
export JAVA_HOME=/usr/lib/java/jdk1.8.0_77
export PATH="$PATH:$JAVA_HOME/bin"
 Finally Check java in terminal.... 

java --version
javac -version
echo $JAVA_HOME

Activate java version 1) Open jdk and oracle jdk
 sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1071      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-7-oracle/bin/java              1065      manual mode
  3            /usr/lib/jvm/java-7-oracle/jre/bin/java          1071      manual mode

Press enter to keep the current choice[*], or type selection number: 

 Finish Java setup in your linux systems.

...Happy Coding....

Comments

Popular posts from this blog

Install Flutter SDK and Permanently set the path in your CentOS or any others Linux Distro

Flutter is Google's UI toolkit for building beautiful, Natively compiled applications for mobile, web, desktop from a single codebase. Now We install Flutter in our new Linux machine for apps development. At first, We go to  Flutter  site and downloads Flutter SDK. And Extract this tar.xz file and move the desired directory. To extract and move to the desired directory following terminal commands... Go to your Downloads directory and typing this ... tar xf flutter_linux_v1.7.8+hotfix.4-stable.tar.xz Finishing this process then you get a new flutter folder. Now You should move this following commands... sudo mv flutter /usr/local/ Now We declare the specific flutter/bin directory address in our system's path. My Systems flutter SDK path is  /usr/local/flutter/bin  . Now typing following commands your terminals... sudo gedit ~/.bashrc When opening a file, then adding following code for declaring the flutter SDK path... export FLUTTER_HOME=/usr/local/flutter export PATH="

How to Downloads videos from youtube or others Video streaming Site in CentOS or any Linux Systems

We can download a full playlist or one video from youtube or other Video streaming site in Linux systems. Now First open your terminal and type following commands for downloading python scripts from Youtube-dl  pages. sudo hwget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl In this commands First we downloads the dl-scripts then move to the /usr/local/bin directories. Now We have to scripts to encable executables. Now typing following commands... sudo chmod a+rx /usr/local/bin/youtube-dl Now You can update this scripts... sudo youtube-dl -U Finally installing process is finished. Now We have downloading videos following commands ... youtube-dl [url] Example: youtube-dl https://www.youtube.com/watch?v=_-Hs6DdcZyY If you have any question, please leave a comment below...