In: Computer Science
After you have fully installed the Ubuntu© operating system to your company’s production servers, you are now responsible for managing and monitoring the servers with Ubuntu© installed. You need to use the virtual environment that you set up with Ubuntu to do the following:
Your team wants to deploy a new application on the servers that needs the latest Java© Development Kit (JDK) and GNU Compiler Collection (GCC). How do you check for which versions of these packages that are currently installed on the servers? In detail, how do you tell your team to update and install the latest versions of these packages on the servers? What commands should they be doing to check? How should your team ensure that the servers are using the latest versions of all packages on the servers in production?
First, open the terminal using ctrl+alt+T from keyboard.
Checking Versions:
Now,in the opened window,simply type:
java -version
Normally,it should display some text similar to this:
openjdk version "1.8.0_141"
OpenJDK Runtime Environment (build 1.8.0_141-8u-b15-3~14.04-b15)
OpenJDK 64-Bit Server VM (build 25.141-b15, mixed mode)
For checking gcc version ,type:
gcc --version or gcc -version
It should display something similar to:
gcc (Ubuntu 5.0.1-19ubuntu1) 5.0.1
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Also check javac(java compiler) version using command:
javac -version
It should return same version as jdk version above.
NOTE: The java and javac version mismatch can make programs to not run partially or in the entirety.
The ubuntu usually chooses the same or appropriate version automatically for java and javac when installing or updating.
Updating to latest version:
Open terminal again and type:
sudo update-alternatives-java