Title: COP%203330
1COP 3330
2Today's topics
- Downloading Java and Eclipse
- Hello World
- Basic control structures
- Basic I/O
- Strings
3Downloading Java
4Downloading Java
5Downloading Java
6Downloading Eclipse
7Downloading Eclipse
8Creating a Java Program With Eclipse
9Creating a Java Program With Eclipse
10Creating a Java Program With Eclipse
11Creating a Java Program With Eclipse
12Creating a Java Program With Eclipse
13Running a Java Program With Eclipse
14Running a Java Program With Eclipse
- Double-click Java Application
15Running a Java Program With Eclipse
16Running a Java Program Using Command Line
17Running a Java Program Using Command Line
18Running a Java Program Using Command Line
19Running a Java Program Using Command Line
- Add the path of the bin directory of your JDK
install to your path environment variable - In my case
- C\Program Files\Java\jdk1.5.0_04\bin
20Running a Java Program Using Command Line
21Running a Java Program Using Command Line
22Running a Java Program Using Command Line
- If you get the error
- Exception in thread "main" java.lang.NoClassDefFou
ndError HelloWorldApp - Make sure youre in the same directory as your
.java file and that you typed everything
correctly - If you still get the error, type at the command
line set CLASSPATH
23Java Virtual Machine
- Java is compiled to Java bytecode, not machine
language - Java bytecode is similar to machine code except
that it is meant for the Java Virtual Machine
(JVM) - The JVM is an interpreter of Java bytecode (i.e.
it runs Java programs)
24Java Virtual Machine
- Machine language must be specific to a processor,
so programs written in most languages must be
recompiled to run on different processors - The same compiled Java program can run on any
computer that can run the correct version of the
JVM