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

Lab 01

This lab manual provides an introduction to setting up the Java development environment, including the installation of the JDK and Eclipse IDE, as well as writing, compiling, and running a simple Java program. Students will learn to create a Java project, write a basic program, and execute it within Eclipse. The lab aims to equip students with foundational skills necessary for future programming tasks in Java.

Uploaded by

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

Lab 01

This lab manual provides an introduction to setting up the Java development environment, including the installation of the JDK and Eclipse IDE, as well as writing, compiling, and running a simple Java program. Students will learn to create a Java project, write a basic program, and execute it within Eclipse. The lab aims to equip students with foundational skills necessary for future programming tasks in Java.

Uploaded by

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

LAB MANUAL

LAB #01

Course Title: Programming Fundamentals LAB


Course Code: IT24-313
Topic: Introduction to Java Development Environment Setting up JDK, IDE (Eclipse),
writing, compiling, and running a simple Java program.
Instructor: Uzair Anees Bhutto | (IT) UMPK

Lab Objective
The objective of this lab is to introduce students to the Java development environment. By the
end of this lab, students will be able to:

1. Set up the Java Development Kit (JDK).


2. Install and configure the Eclipse IDE.
3. Write, compile, and run a simple Java program.

Technologies/Tools Required:
 JDK (Java Development Kit): The software development environment for writing
Java applications.
 Eclipse IDE: An integrated development environment for Java.

Step 1: Install JDK


1. Download JDK:
o Visit the official Oracle website: JDK Download Page.
o Download the latest version of JDK compatible with your operating system.
2. Install JDK:
o Run the downloaded installer and follow the installation instructions.
o Note the installation path (e.g., C:\Program Files\Java\jdk-<version>).
3. Set Up Environment Variables (Windows):
o Open the Start menu, search for "Environment Variables," and click "Edit the
system environment variables."
o In the System Properties window, click "Environment Variables."
o Under "System Variables," find the Path variable and click "Edit."
o Add the path to the JDK bin directory (e.g., C:\Program Files\Java\jdk-
<version>\bin).
o Click "OK" to save the changes.
4. Verify JDK Installation:
o Open Command Prompt (Windows) or Terminal (macOS/Linux).
o Type java -version and press Enter.
o If the JDK is installed correctly, you will see the version details.

Step 2: Install Eclipse IDE


1. Download Eclipse:
o Visit the official Eclipse website: Eclipse Download Page.
o Download the Eclipse IDE for Java Developers.
2. Install Eclipse:
o Extract the downloaded file to a preferred location (e.g., C:\Eclipse).
o Open the extracted folder and run the eclipse.exe file.
3. Set Up Workspace:
o When Eclipse starts, it will prompt you to select a workspace.
o Choose a directory where your projects will be stored
(e.g., C:\Users\<YourName>\EclipseWorkspace).
o Click "Launch."

Step 3: Create a Java Project in Eclipse


1. Open Eclipse:
o Launch Eclipse from the installed location.
2. Create a New Java Project:
o Go to File > New > Java Project.
o Enter a project name (e.g., PROGRAMMING FUNDAMENTALS_LAB).
o Click "Finish."
3. Create a Java Class:
o In the Project Explorer (left panel), right-click on the src folder of your project.
o Select New > Class.
o Enter the class name (e.g., lab_01).
o Check the box for public static void main(String[] args) to create the main
method.
o Click "Finish."
Step 4: Write a Simple Java Program
1. Write the Code:
o In the lab_01 class, write the following code:
public class lab_01 {
public static void main(String[] args) {
System.out.println("WELCOME FUTURE IT EXPERTS OF 2K25 BATCH
AT THE UNIVERSITY OF MIRPURKHAS");
}
}
2. Save the File:
o Press Ctrl + S to save the file.

Step 5: Compile and Run the Program


1. Run the Program:
o Right-click anywhere in the code editor.
o Select Run As > Java Application.
2. View the Output:
o The output WELCOME FUTURE IT EXPERTS OF 2K25 BATCH AT
THE UNIVERSITY OF MIRPURKHAS will be displayed in the Console tab
at the bottom of the Eclipse window.

Conclusion
In this lab, you learned how to set up the Java development environment, install Eclipse IDE,
and write, compile, and run a simple Java program. These skills will form the foundation for
your future programming tasks in Java.

"In the world of Java, every line of code is the beginning of a masterpiece. Just like a 'main
method' is the entry point of a program, your first year is the entry point to endless possibilities.
Compile your dreams, debug your doubts, and run toward success. Remember, even the most
complex algorithms start with a single line of code. Keep coding, keep growing!"

You might also like