4. HARD WORK VS SMART WORK
• Hard work - means that you have to do all the java path
establishment, creation of program, compilation and execution
of java program by you own.
• Smart Work – means the use of an IDE(Interacted Development
Environment) through which we can create java programs using
drag and drop facility.
• In this session, you will learn the installation, complilation and
execution of java program manually (hard work)
5. STEP -1 JDK INSTALLATION PROCESS
• For the JDK(Java Development Kit) installation first of all we have to go on
the oracle.com website and find the latest version of JDK.
• There is a link from where you can download the JDK latest version
https://www.oracle.com/java/technologies/javase-jdk15-downloads.html
Download the latest version and copy it in a folder named as java on your
drive like C drive/D drive or any other local drive now unzip the downloaded
file for example in this case e:java and find the path of javac which is a java
compiler. Generally it is available in bin folder of our jdk folder.
When you unzip the downloaded file you will find the JDK-15 folder in which
there will be a bin folder. Select the bin folder and copy the path which we will
require at the time of setting of path of our program to java library.
This will be
E:javajdk-15bin
6. STEP – 2 CREATION OF PROGRAM
• Create a folder in the drive of your choice on your computer
• Open any basic editor like NOTEPAD, NOTEPAD++, WORDPAR
or any other of your choice
• Write a program as given in the following slide and save it in
your java program folder as e:java program
7. public class a
{
public static void main(String
args[])
{
System.out.println("hello");
}
}Note : - Things to remember
• Java is a case sensitive language so please check the capital and small
letters used in this program
• When you save this program save it with the name as “class-name.java” for
example in the above code our class name is a so we have to save this
program with the name of “a.java”.
8. STEP 3 - SETTING THE PATH
• To compile our program we have to set a path to our java
complier and interpreter.
• Now you have to go in run and type cmd
• It will open a command prompt window as in the following
slides
9.
10.
11. STEP 3 - SETTING THE PATH – CONTD….
• Now get the location of javac.exe
• As you see there is a working directory is c:usershp but we have to
change to the java program folder.
• Now shift the drive as
• c:userhp>e:
• E:>cd “java progam”
• E:java program>
• Now type the path command as
• E:java program> set path=E:javajdk-15bin
This path is
the same
path which
weget in step
1
12. STEP 4 COMPLIALTION OF JAVA PROGRAM
• As soon as the path has been created now we have to execute our
java program using java complier(javac.exe) so type the following
command
E:java program>javac a.java
• Complier will display all the list of error so now you have to remove
all the error present in program. After the debugging, java compiler
will create a (filename.class) file which is actually a byte code. In this
example a.class will be created
• Finally interpret your java class file using java interpreter
E:java program>java a
• And your java program will get executed.