Java checking installation

In previous tutorial we have learned , how to install jdk. In this tutorial we are going to check whether java is installed correctly or not.

How to Check whether (Jdk) java is Installed or not ?

Step 1 : Checking Directory Structure

  1. After installing JDK , Restart system.
  2. Open My Computer and Check Java Installation Directory.

  1. These two folders gets created inside “My Computer => C Drive => Program File => Java“.
  2. Check Inside JDK folder and look for “java” , “javac” application files.

  1. If these files are present then 75% we are on right track. Now Let’s Check whether “javac” is working properly or not.

Step 2 : Writing Sample Hello.java Program

  1. Create “code” folder inside C Drive. (call it as - hello.java)
  2. Copy paste following code snippet and paste into notepad. (Dont forgot to save File using .java extenstion) .
class hello
{
public static void main(String args[])
  {
  System.out.println("Welcome to Java");
  }
}
  1. Note : Select File Type as All files.

  1. Now open Command Prompt.
  2. Type following Commands.
C:Usersp.abhiman.taral>cd
C:>cd code
C:code>javac hello.java
C:code>java hello
Welcome to Java
C:code>

If you are successful in getting “Welcome to Java” then you have installed java Correctly.