Tuesday, October 31, 2017

How to install OpenJDK 8 Ubuntu

Check Java:
java -version

If it returns "The program java can be found in the following packages", Java hasn't been installed yet, so execute the following command:
 
sudo apt-get install default-jre
 
 
If you face any issue like "folder not found" or "package not found",
 
check the PROXY if it is set :
sudo grep -R roxy /etc/apt/*

grep roxy /etc/environment

echo $http_proxy

echo $ftp_proxy

grep roxy /etc/bash.bashrc

grep roxy ~/.bashrc
 
 
 
SET PROXY by all these steps serially :
 
 

1. For gtk3 programs such as rhythmbox and online accounts:

First you need to enter proxy settings in network settings (along with authentication):
enter image description here
Then apply system wide.

2. For apt,software center etc

edit the file /etc/apt/apt.conf
And then replace all the existing text by the following lines
Acquire::http::proxy "http://username:password@host:port/"; Acquire::ftp::proxy "ftp://username:password@host:port/"; Acquire::https::proxy "https://username:password@host:port/";

3. Environment variables

edit the file /etc/environment
And then add the following lines after PATH="something here"
http_proxy=http://username:password@host:port/ ftp_proxy=ftp://username:password@host:port/ https_proxy=https://username:password@host:port/ 


After setting proxy Enter this command:

sudo apt-get install default-jre
 
sudo apt-get install default-jdk
 
Then check java version, if you get the installed package and version then You are good to go!!!!! 

No comments:

Post a Comment