T Start
T Start
(http://docs.oracle.com/javase/tutorial/getStarted/
index.html)
Objectives
• About the Java Technology
• What can Java Technology do?
• How can Java support platform-
independence?
• Java Platform
• Set up Environment Variables
• The first Java program in the NetBeans
• Structure of a Java program.
• End users run Java Programs
About the Java Technology(1)
History
– 1990, James Gosling, Bill Joy, Patrick Naughton(Sun
Microsystem) developed the Oak language for
embedding programs to devices such as VCR, PDA
(personal data assistant). The Oak programs require:
- Platform independent/- Extremely reliable/ - Compact
– 1993, interactive TV and PDA failed, Internet and Web
were introduced, Sun change the Oak to an internet-
development environment with a new project, named
Java.
– 1994, the Sun’s HotJava Browser was introduced
(written using Java). It showed the strength of Java
applets and abilities to develop Java application.
About the Java Technology(2)
History…
Java Compiler
Javac.exe
Platform-Independent
Java byte-code: file.class
More details:
https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-1.html#jvms-1.1
Java Platform
• A platform is the hardware or software environment
in which a program runs.
• The Java platform has two components:
• The Java Virtual Machine
• The Java Application Programming Interface (API)
Operating System
Set up Environment Variables
After installing JavaSE
(Java Development Kit Standard
Edition),
environment
variables should be
setup to point to the
folder in which JavaSE
is installed.
Steps: My Computer/
Properties/
Advanced/Environment
Variables/System
Variables/ Path/ Edit
Why? The point at the beginning of the CLASSPATH means that
classes will be searched first in the current working folder.
The first Java program in the NetBeans
If this option is
checked,
NetBeans will
automatically
generate a
class, named
Main, for the
project.
In Windows Explorer
In NetBeans
Step 2: Add a
Java Class
Package:
Subdirectory of the
folder Project/SRC
Read
recommendation