Java Starting


Published on

Presented by: N.V.Rajasekhar Reddy

Want more interesting...
Watch and Like us @
subscribe videos @

Published in: Education
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • STEP 1: Download JDKGoto Java SE download site @ the "Download" button under "JDK" of "Java SE 7".Choose your operating platform, e.g., Windows x86 (for 32-bit Windows OS - "jdk-7u2-windows-i586.exe" 84MB); or Windows x64 (for 64-bit Windows OS).(For Mac Users Only) Download JDK from and follow the instructions to install (or google "how to install JDK on Mac").STEP 2: Install JDK/JRERun the downloaded installer, which installs both the JDK (Java Development Kit) and JRE (Java Runtime). By default, the JDK and JRE will be installed into directories "C:\\Program Files\\java\\jdk1.7.0" and "C:\\Program Files\\java\\jre7", respectively. For novices, accept the defaults.I shall refer to the JDK installed directory as <JAVA_HOME>, hereafter, in this article.(For Advanced Users Only)The default JDK/JRE directories work but I recommend avoiding "Program Files" directory because of that blank character in the directory name. You may change the installed directories for JDK and JRE during installation. I personally installed JDK and all my programming tools in "d:\\bin" (instead of "C:\\Program Files") for ease of maintenance.It is always cleaner to un-install all the out-dated JDK/JRE before installing a new version.STEP 3: Include JDK's "bin" directory in the PATHWindows Operating System searches the current directory and the directories listed in the PATH environment variable for executable programs invoked from the CMD shell. JDK's programs (such as compiler javac.exe and runtime java.exe) reside in directory "<JAVA_HOME>\\bin" (where <JAVA_HOME> denotes the JDK installed directory you have chosen in the previous step). You need to include the "<JAVA_HOME>\\bin" directory in the PATH environment variable.To edit the PATH environment variable in Windows 2000/XP/Vista/7:Click the "Start" button ⇒ "Control Panel" ⇒ "System" ⇒ (Vista/7 only) "Advanced system settings".Switch to "Advanced" tab ⇒ "Environment Variables..."In "System Variables" box, scroll down to select "PATH" ⇒ "Edit..."In "Variable value" field, INSERT "c:\\Program Files\\java\\jdk1.7.0\\bin" (assume that this is your JDK's binary directory) IN FRONT of all the existing directories, followed by a semi-colon (;) which separates the JDK's binary directory from the rest of the existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications may not run. Variable name : PATH Variable value : c:\\Program Files\\java\\jdk1.7.0\\bin;....exiting entries.... (For Advanced Users Only) I suggested that you place the JDK binary directory in front of "c:\\windows\\system32" and "c:\\windows". This is because some Windows systems may have an out-dated copy of JDK/JRE in these directories. Do a search for "java.exe", and you will be amazed of the findings.You could read "Java Applications and Environment Variable" for more discussions about PATH environment variable.(For Mac and Linux Users Only) You can set the environment variables JAVA_HOME and PATH in your .profile or .bashrc or .bash_profile (under your home directory $HOME) by including the following commands:export JAVA_HOME=path_to_JDK_directory export PATH=$JAVA_HOME/bin:$PATH For Mac OS X, the path_to_JDK_directory is probably /Library/Java/Home. For Linux (Ubuntu), it is probably /usr/lib/jvm/java-7-xxx.STEP 4: Verify the JDK InstallationLaunch a CMD shell (click the "Start" button ⇒ run... ⇒ enter "cmd"), andIssue a "path" command to list the content of the PATH environment variable. Check the output and make sure that <JAVA_HOME>\\bin is listed in the PATH. prompt> pathPATH=c:\\Program Files\\java\\jdk1.7.0\\bin;......other entries......Issue the following commands to verify that JDK is properly installed and display its version: prompt> java -version java version "1.7.0"Java(TM) SE Runtime Environment (build 1.7.0-b147)Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing) prompt> javac Usage: javac <options> <source files> ......... .........STEP 5: Compile & Run a Java Hello-world ProgramRead "Writing your First Java Program with JDK and a Programming Text Editor". "Everything that can possibly go wrong will go wrong": Read "JDK Installation Common Errors".STEP 6: Download JDK API DocumentationThe JDK download does not include the documentation, which needs to be downloaded separately. In the past, I always insist that my students should have a local copy of JDK API Documentation. But, today, you can easily access the online copy by googling "JDK 7 Documentation".To install JDK API documentation:From the Java SE download page (@, look for "Java SE 7 Documentation" (under "Additional Resources") ⇒ Download the zip-file (e.g., "" - about 57MB).Unzip into the <JAVA_HOME> (JDK installed directory). The documentation will be unzipped into "<$JAVA_HOME>\\docs". Browse the JDK documentation by opening "<JAVA_HOME>\\docs\\index.html".STEP 7: (For Advanced Users Only) JDK's Source CodeSource code for JDK is provided and kept in "<JAVA_HOME>\\". I strongly recommend that you to go through some of the source files such as "", "", and "", under "java\\lang".
  • Java Starting

    1. 1. JAVA SE
    2. 2. OBJECTIVES: Introduction Need of Programming languages Different Programming languages Java need in today’s world Categorization of java Installation of a JDK Execution of a java program JRE – JVM – JDK – SDK - IDE
    3. 3. Introduction A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.
    4. 4. Contd… The description of a programming language is usually split into two components. They are Syntax (form) and Semantics (meaning). Finally programming language is a language, which is used to maintain communication with a System.
    5. 5. Need of Programming languages
    6. 6. Different Programming languagesApplications and Artificial Intelligence Database development Script developmentProgram developmentdevelopment DBASE awkC AIML FoxPro bashC# C MySQLC++ C# SQL BatchfileD C++ Visual FoxPro PerlJava Prolog TclTclVisual BasicGame Computer drivers or Internet and web pagedevelopment other hardware development interface developmentC HDMLC# HTMLC++ Assembly C JavaDarkBASIC JavaScriptJava Perl PHP XML
    7. 7. Java needs in today’s world For Desktop Enterprise Go Mobile Embedded Internet (Client/Server)
    8. 8. Categorization of java Java Card Micro Edition (ME) JAVA ME Standard Edition (SE) JAVA SE Enterprise Edition (EE) JAVA EE JavaFX PersonalJava (discontinued)
    9. 9. Java Platform & VM & Devices
    10. 10. Versions of java JDK 1.0 (January 23, 1996) JDK 1.1 (February 19, 1997) J2SE 1.2 (December 8, 1998) J2SE 1.3 (May 8, 2000) J2SE 1.4 (February 6, 2002) J2SE 5.0 (September 30, 2004) Java SE 6 (December 11, 2006) Java SE 7 (July 28, 2011)
    11. 11. Installation of a JDK (JAVA SE) Video reference
    12. 12. Execution of a java program Write a program in Notepad or IDE or any text editor Save as Compile javac Run java
    13. 13. Source Computer Java Program Compilation Java ByteCode Internet Verification Your computer Restricted Env.Java ByteCode Execution
    14. 14. Execution model of javasource bytecode (text) compiler (aka. class file) JVML dynamic loading virtual machine verifier JIT compiled bytecode code compiler interpreter CPU
    16. 16.  JVM : A self-contained operating environment that behaves as if it is a separate computer. For example, Java applets run in a Java virtual machine (JVM) that has no access to the host operating system. JRE: Java Run-Time Environment is the part of the Java Development Kit (JDK) required to run Java programs. It comprises the Java Virtual Machine, the Java platform core classes, and supporting files. It does not include the compiler, debugger, or other tools present in the JDK. ...
    17. 17.  JDK(Java Development Kit) : software development package from Sun Microsystems that implements the basic set of tools needed to write, test and debug Java applications and applets SDK(Software Developers Kit) a set of tools, including API, frameworks, interface elements, etc. used to create software, i.e. apps. IDE: An integrated development environment (IDE) (also known as integrated design environment, integrated debugging environment or interactive development environment) is a software application that provides comprehensive facilities to computer programmers for software development.
    18. 18. Questions…1) What is the use of bin and lib in JDK? A) Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all packages.2) Question: Whats the difference between J2SDK 1.5 and J2SDK 5.0? A) Theres no difference, Sun Microsystems just re-branded this version.3) The Differences among Java, C And C++ ? A) Paradigm , Preprocessor, Memory Management, Pointers, Bounds Checking, Portability And Performance, Complex Data Types, Strings, Multiple Inheritance, Goto Statement …
    19. 19. Feature C C++ Java OOP, Generic Procedural, OOP, GenericParadigms Procedural Programming (from Java Programming 5)Form of Compiled Source Executable Native Code Executable Native Code Java bytecodeCode Managed, using a garbageMemory management Manual Manual collector Yes, very commonly used, No pointers; referencesPointers Yes, very commonly used. but some form of are used instead. references available too.Preprocessor Yes Yes NoString Type Character arrays Character arrays, objects ObjectsComplex Data Types Structures, unions Structures, unions, classes Classes Single class inheritance,Inheritance N/A Multiple class inheritance multiple interface implementationOperator Overloading N/A Yes No Yes, with warnings if loss Yes, with warnings if loss Not at all if loss couldAutomatic coercions could occur could occur occur; msut cast explicitlyVariadic Parameters Yes Yes NoGoto Statement Yes Yes No
    20. 20. To be contd…