How to setup java development kit on ubuntu


Download the latest jdk file in .tar.gz format from given link below

extract the .tar.gz file
open terminal
type:- sudo tar -zxf jdk_file_name.tar.gz -C /path/to/extract
Now set the latest jdk your default jdk
type:-
sudo update-alternatives --install /usr/bin/java java /jdk/home/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /jdk/home/bin/javac 1
Now check your java version
type:- java -version
you will find your java installed
in additional you can set JAVA_HOME variable in path
type :-
sudo nano /etc/bash.bashrc
add this lines at the end of file
JAVA_HOME=/path/to/jdk/
export JAVA_HOME
now save your changes and run !!!!!!!!!!!!!

Comments

Popular posts from this blog

Java 10 and 10 Big Java Milestones

Java 21 Features With Example

JavaFX adds docking library for easier use, better customization