0% found this document useful (0 votes)
10 views

Setting Up Environment For JAVA Programming

The document provides instructions for setting up the environment for Java programming. It details prerequisites like a text editor and IDE. It checks if Java is already installed and provides instructions to install Java. It also covers creating environment variables and testing a sample Java program.

Uploaded by

Raphael Jimeno
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Setting Up Environment For JAVA Programming

The document provides instructions for setting up the environment for Java programming. It details prerequisites like a text editor and IDE. It checks if Java is already installed and provides instructions to install Java. It also covers creating environment variables and testing a sample Java program.

Uploaded by

Raphael Jimeno
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Setting Up Environment for JAVA

Programming
Pre-requisite
 Your favorite text editor: Notepad, Notepad++, Sublime Text, and etc.
 Integrated Development Environment (IDE) Software (Optional)
 Java VM - https://www.java.com/en/download/windows_manual.jsp

Before you install


This section instructs you on how to use check if JAVA is installed or not, If already installed
then the Version Number of the installed one.

These instructions are specialized to Windows 7, but are similar for Windows 10, Windows 8,
Windows XP and Windows Vista.

1. Select Start -> Control Panel -> Add/Remove Programs,


2. Here you can see the list of installed software on your computer. The list is displayed in
alphabetical order.
3. Check if Java name is listed in the installed software list. You might have either JRE(Java
Runtime Environment) which is required to run java applications on the computer or
JDK as shown below.

Other ways to check if java is installed:


1. Open command prompt and enter “java –version”. If installed version number is displayed.
2. On Windows, Java is usually installed in the directory C:/Program Files/Java. You can check if this
folder exists. If the folder does not exist, we can’t be sure that Java is not installed on your computer. It
could have been installed in a different path.

Install Java
Setting up Environment Variables
To create or modify environment variables on Windows 10:
1. On the Windows taskbar, right-click the Windows icon and select System.
2. In the Settings window, under Related Settings, click Advanced system settings.

3. On the Advanced tab, click Environment Variables.


Figure 7-2 Environment Variables Dialog in Windows

4. Click New to create a new environment variable. Click Edit to modify an existing


environment variable.
5. After creating or modifying the environment variable, click Apply and then OK to have the
change take effect.
Note:
The graphical user interface for creating environment variables may vary slightly, depending on
your version of Windows.

Testing a JAVA Program


1. Download and save the file TestProgram.java in your downloads folder.
2. Open CMD tool and navigate to the directory where the TestProgram.java is saved using the
command cd <directory>.

3. Run the TestProgram.java using the below command and hit enter.
Java TestProgram.java
Troubleshooting
1. Java is installed but I encounter an error when running java -version in cmd.
Answer: Check if environment variable for java is available. Note that java directory will depend
on your installation.

You might also like