Learning Java : First step - the Basics


Introduction

First I am going to start with few links that explains about the the basics of Java programming.
I learned java and object-oriented learning only from the Sun tutorial and hence planning to start the introductory section from there.
Things to do:
  1. Install and run "hello world" application. The first step in learning any programming language is to run a "hello world" program. The link below provide more about it. Please go through all the section (takes ~10 to 15 minutes)
  2. Learn about object oriented programming concept from the following link (10 to 15 minutes)
Reference - Sun Java main tutorial link:
If you finished the above steps then, you should have run the first java application from command-line DOS shell. In summary, you would have learned how a simple java program looks like, concepts of compiling and running java application.
Next I will explain how the same application can be run from an IDE (Integrated Development Environment).
Problems faced
  •  In Windows machine, I could not find the 'javac' binary program to compile the code
    • JDK should be downloaded and installed if we have to use Java for compiler
  • What are JRE, JDK, JEE and other acronymns?
    • JRE - Java Runtime Environment - For desktop stand-alone applications,  contains only files required to run java applications.
    • JDK -  Java Standard Edition Development kit - For desktop applications, contains all the binary files to compile and run java applications. JRE is the subset of JDK
    • JEE - Java Enterprise Edition - For web applications and enterprise level applications. JRE is the subset of JEE.
  • When I run 'javac HelloWorldApp.java' in Command-line, I am getting '''javac' is not recognized as an internal or external command, operable program or batch file.'" error message?
    • The PATH variable is not set correctly. 
    • Solution 1 : Setup the windows PATH variable.
    • Solution 2 : user the full path to compile the code 
      • "C:\Program Files\Java\jdk1.6.0_17\bin\javac" HelloWorldApp.java
    • HelloWorldApp.java
    class HelloWorldApp {
       public static void main(String[] args) {
           System.out.println("Hello World!"); // Display the string.
       }
    }