INTRODUCTION TO JAVA
Defining Java
History of Java
Java Technology
Features of Java
Java Requirements
Java Development Environment
Applet and Application
Java Program Cycle
*Property of STI J0007
Java is a high-level programming language
developed by Sun Microsystems.
Defining Java
Java can be used to write applets (small
applications running inside other applications
hence the diminutive suffix 'let') but is not the
only language that can produce applets.
*Property of STI J0007
Java was developed at Sun Microsystems, Inc.
(Sun) by James Gosling.
The language needed to be small, fast, reliable,
and portable (hardware independent).
History of
Java With the goals it had achieved (smallness,
speed, reliability, portability), Java was
discovered to be ideal for web pages.
Java can also be used to write stand-alone
applications.
*Property of STI J0007
A programming language
Java A development environment
Technology
An application environment
A deployment environment
*Property of STI J0007
Object-Oriented
Java uses classes to organize code into logical modules
Portable and Platform-Independent
Java is platform-neutral, which means that programs developed
with Java can run on any computer system with no changes
Features of Dynamically Linked
Java codes are linked at runtime
Java
Multithreaded
Java programs can contain multiple threads of execution
Garbage Collected
Java does its own garbage collection, which means that programs
are not required to delete objects allocated in memory
*Property of STI J0007
Pentium D processor or higher
Java
Requirements At least 128MB of RAM
Using an applet within a Web Browser with
JDK plug-in
*Property of STI J0007
Installing JDK (Java Development Kit) produces
several folders in your system. Each of these
folders holds pertinent files that would be
necessary in building your program. For
instance, the bin folder contains executable files
for compiling your program (javac.exe).
Java
Development j2sdk1.4.0
Environment
bin demo docs include jre lib
*Property of STI J0007
Since javac.exe (the one that compiles your
program) is located in the bin directory. It is
necessary to execute this command, by doing so
you can now compile on any directory your
program may be.
Java
Development
Environment
– Using Path
PATH=C:\J2SDK1.4.0\BIN;%PATH%;
*Property of STI J0007
The class path is used to tell Java where to look
for classes. Set the environment variable
CLASSPATH if there’s a need to look for classes
in different folders.
Java
Development SET CLASSPATH=C:\CLASSES;C:\NEWCLASSES;
Environment
– Using
CLASSPATH
*Property of STI J0007
The tool to be used for programming is called
JCreator.
You can get a copy of JCreator at
http://www.jcreator.com
Download the free version (JCreator LE).
Java Learn more about JCreator by surfing their site.
Development
Environment
*Property of STI J0007
<Click> this
Java
Development
Environment
*Property of STI J0007
Other Java programming environment:
Java Symantec Visual Café
Development Microsoft J++
Environment Borland JBuilder
IBM Visual Age for Java
Sun Java Forte
Java 2 SDK 1.4.2 FCS
*Property of STI J0007
Applets and Applications
Java can be used to create two types of programs:
Applet
special applications designed to run within the context of
a Web browser
Application
stand-alone program that does not need a browser to run
*Property of STI J0007
Use any text editor to create source code —
.java file
Source code compiled according to JVM to get
byte code — .class file
Byte code executed using an interpreter
Java Program
Cycle
source byte
code Compiler Interpreter
code
*Property of STI J0007