Install Java in terminal

Install Java in terminal

YAJC become Java programmer

In this short video we will see how one can install JDK from terminal.

JDK installation

Let's have a walkthrough the main steps:

java

this is the program we can use to run Java programs. On this step we ensure that there is no java installed

sudo apt install openjdk-17-jdk-headless

execute program apt with install command specifying we would like to install openjdk-17-jdk-headless package. Here sudo is the program which allows us to modify system files/directories. headless - simply say, this means we don't need to work with display, there will be no graphics but only command line interface.

java

we invoke java program again and see it has a different output. It displays info describing how to use java program and which arguments you can pass.

java usage
java -version

invoke java program with -version argument to see the actual version of Java installed.

Next steps

In next articles we will create some very simple programs using command line interface, see you ✌

Report Page