Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

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!!!!! 

Monday, November 21, 2016

How to install OpenJDK 8 Ubuntu



Use this commends to Install

  1. sudo add-apt-repository ppa:openjdk-r/ppa
  2. sudo apt-get update
  3. sudo apt-get install openjdk-8-jdk
  4. sudo update-alternatives --config java
  5. sudo update-alternatives --config javac

Monday, July 13, 2015

java.lang.OutOfMemoryError: Java heap space

copy and paste the code on commend line 

set JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"