Wednesday, September 9, 2020

Java and Ubuntu 20.04.1 LTS

Starting to work with Java in your  Ubuntu 20.04.1 LTS


Java is installed by default in Ubuntu 20.04.1 LTS. However, you should PIP, which will allow you to install Python Software packages.


1) Make sure about your Ubuntu version:

Ubuntu@CA-777:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description:    Ubuntu 20.04.1 LTS    -> This is your version

Release:        20.04

Codename:       focal


2) Update your repository list:

Ubuntu@CA-777:~$ sudo apt update


3) Find out if Python is not already installed:

Ubuntu@CA-777:~$ python3 --version

Python 3.8.2   ->  This is your Version!

4) Installing/Updating supporting software:

Ubuntu@CA-777:~$ sudo apt install software-properties-common

[sudo] password for belairlab:

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following additional packages will be installed:

  python3-software-properties

The following packages will be upgraded:

  python3-software-properties software-properties-common

2 upgraded, 0 newly installed, 0 to remove and 46 not upgraded.

Need to get 35.8 kB of archives.

After this operation, 0 B of additional disk space will be used.

Do you want to continue? [Y/n] y

Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 software-properties-common all 0.98.9.2 [10.6 kB]

Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-software-properties all 0.98.9.2 [25.2 kB]

Fetched 35.8 kB in 1s (43.4 kB/s)

(Reading database ... 31857 files and directories currently installed.)

Preparing to unpack .../software-properties-common_0.98.9.2_all.deb ...

Unpacking software-properties-common (0.98.9.2) over (0.98.9.1) ...

Preparing to unpack .../python3-software-properties_0.98.9.2_all.deb ...

Unpacking python3-software-properties (0.98.9.2) over (0.98.9.1) ...

Setting up python3-software-properties (0.98.9.2) ...

Setting up software-properties-common (0.98.9.2) ...

Processing triggers for man-db (2.9.1-1) ...

Processing triggers for dbus (1.12.16-2ubuntu2.1) ...

Ubuntu@CA-777:~$

5) Install PIP:

Ubuntu@CA-777:~$ sudo apt install python3-pip

    You will be prompted, Type Y:

6) Verify that PIP was installed:

6) Create your first program, it will print  "Hello World!. 

Extension needs  to be .py:

Ubuntu@CA-777:~$ vi test.py

Ubuntu@CA-777:~$ cat test.py  

print("Hello World!.")

7) Execute your program:

Ubuntu@CA-777:~$ python3 test.py

Hello World!.


I recommend the following Website to start  learning Python programming:

https://www.learnpython.org/



No comments:

Post a Comment