0% found this document useful (0 votes)
66 views3 pages

JDK Installation On Window and Ubuntu

This document provides instructions for installing Java on Ubuntu and Windows operating systems. For Ubuntu, it describes how to configure proxy settings, update the system, check the Java version, and edit files to set the JAVA_HOME environment variable. For Windows, it explains how to download the JDK, install it, and set the JAVA_HOME and Path variables either temporarily or permanently. It also lists some text editors and IDEs that can be used for Java development, such as Notepad++, NetBeans, and Eclipse.

Uploaded by

Sudhakar Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views3 pages

JDK Installation On Window and Ubuntu

This document provides instructions for installing Java on Ubuntu and Windows operating systems. For Ubuntu, it describes how to configure proxy settings, update the system, check the Java version, and edit files to set the JAVA_HOME environment variable. For Windows, it explains how to download the JDK, install it, and set the JAVA_HOME and Path variables either temporarily or permanently. It also lists some text editors and IDEs that can be used for Java development, such as Notepad++, NetBeans, and Eclipse.

Uploaded by

Sudhakar Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Installation on Ubuntu

1. Configure Proxy Setting for Proxy Server

$ sudo gedit /etc/apt/apt.conf

[Add the following lines]


Acquire::http::Proxy "http://user-id:password@proxy-address:port ";
Acquire::https::Proxy "https://user-id:password@proxy-address:port";
Acquire::ftp::Proxy "ftp://user-id:password@proxy-address:port ";

2. Update the Ubuntu, if not updated

$ sudo apt-get update

3. Verifying Java Installation, if it is already installed or not

$ java -version

[If Java is already, installed on system, it gives the response somewhat like below for java-7 –
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b13)
Java HotSpot(TM) Client VM (build 25.0-b02, mixed mode)

In case Java is not installed, then Install Java with following command.]
$ sudo apt-get install openjdk-7-jdk

4. Edit ~/.bashrc file by adding java path

$ sudo gedit ~/.bashrc


[Add the following line to ~/.bashrc file. It means adding the location to the PATH variable]
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export PATH==$PATH:$JAVA_HOME/bin

5. Reload the changed ~/.bashrc settings

$ source $HOME/.bashrc

Installation on Window
1. Download JDK
Download the latest and compatible version of JDK from the below link
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-
2133151.html

2. Install the downloaded exe file

Double click on exe file, it will be installed silently.

3. Setting up path for Java

If you are saving the java source file inside the C:\Program Files\Java\jdk1.8.0_121\bin
directory, path is not required to be set because all the tools will be available in the current
directory.

But, if you are having your java file outside the C:\Program Files\Java\jdk1.8.0_121\bin folder, it
is necessary to set path of JDK. Path can be set in two ways: temporary and permanent.

3.1 Setting up Temporary Path

Follow the following steps:

Open a Windows command prompt (Windows key + R -> enter cmd -> OK). Write following
command in command prompt. For different version of jdk or different location, copy the path of
jdk/bin directory (your JDK installation path may be different).

> set path= C:\Program Files\Java\jdk1.8.0_121\bin

3.2 Setting up Permanent Path

Follow the following steps:

Right-click on Computer -> Properties -> Advanced system settings; then in the Advanced tab,
click Environment Variables... -> System variables -> New....

Give the new system variable the name JAVA_HOME and the value value C:\Program
Files\Java\jdk1.8.0_121 (depending on your JDK installation path it varies).

Then select the Path system variable and click Edit.... Keep the variable name as Path, and
append C:\Program Files\Java\jdk1.7.0_79\bin; or %JAVA_HOME%\bin; (both mean the same)
to the variable value. Do not delete any content already present there in the value of path.

The same procedure can be repeated for the user variables (Computer -> Properties -> Advanced
system settings; then in the Advanced tab, click Environment Variables... -> User variables)
Open a Windows command prompt (Windows key + R -> enter cmd -> OK), and check the
following:
> java -version
> javac –version

IDE/Editors for JAVA


For writing Java codes, a text editor is required. Note pad is most basic but some sophisticated
IDEs (Integrated development environment) are also available like netbeans and eclipse.

Notepad: Simple text editor inbuilt in Window OS

Notepad++: Notepad++ is a free source code editor that supports several languages can
be downloaded from https://notepad-plus-plus.org/

Netbeans: A Java IDE that is open-source and free which can be downloaded
from https://www.netbeans.org/index.html

Eclipse: A Java IDE developed by the eclipse open-source community and can be downloaded
from https://www.eclipse.org/

References
https://stackoverflow.com/questions/1672281/environment-variables-for-java-installation
http://docs.oracle.com/javase/tutorial/essential/environment/paths.html
https://www.java.com/en/download/help/path.xml
https://www.javatpoint.com/how-to-set-path-in-java
https://www.tutorialspoint.com/java/java_environment_setup.htm

You might also like