15_COMPC_Sakshi Sharma_P1
15_COMPC_Sakshi Sharma_P1
15_COMPC_Sakshi Sharma_P1
Learning Objective: Student should be able to install Java, set the environment variables and run
a simple java program
Tools: Java under Windows environment
Theory: Install Java, set the environment variables and run a simple java program
Installing Java:
If you have previously installed older version(s) of JDK/JRE, un-install ALL of them. Goto "Control
Panel" ⇒ (optional) "Programs" ⇒ "Programs and Features" ⇒ Un-install ALL programs begin with
"Java", such as "Java SE Development Kit ...", "Java SE Runtime ...", "Java X Update ...", and etc.
Step 1: Download JDK
1. Goto Java SE download site
@ http://www.oracle.com/technetwork/java/javase/downloads/index.html.
2. Under "Java Platform, Standard Edition" ⇒ "Java SE 11.0.{x}", where {x} denotes a fast
running security-update number ⇒ Click the "Oracle JDK" "Download" button.
3. Under "Java SE Development Kit 11.0.{x}" ⇒ Check "Accept License Agreement".
4. Choose the JDK for your operating system, i.e., "Windows". Download the "exe" installer (e.g.,
"jdk-11.0.{x}_windows-x64_bin.exe" - about 150MB).
3. Issue the following commands to verify that JDK/JRE are properly installed and display their
version:
PROGRAM :
importjava.util.*;
public class newClass
{
int u=5;
public static void main(String [] args)
{
newClass q=new newClass();
System.out.println(q.u);
}
}
Output :
5
Screenshot of my Program:
Learning Outcomes: The student should have the ability to
LO1: identify problems during installation of Java.
LO2: Set the environmental variables
LO3: Run sample program in java.
LO4: Correct problems while execution of program.
Course Outcomes:Upon completion of the course students will be able to install java and
execute programs.
Conclusion: In this experiment, we understood how to install java in our system and learned
about JVM, JDK, and IDE. Following all the steps we successfully installed java and checked
the version we have installed. We have run one program and the screenshot of same is
attached.