COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control...
-
Upload
rudolf-solomon-johns -
Category
Documents
-
view
225 -
download
2
Transcript of COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control...
![Page 1: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/1.jpg)
COP 3330
Notes 1/12
![Page 2: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/2.jpg)
Today's topics
• Downloading Java and Eclipse
• Hello World
• Basic control structures
• Basic I/O
• Strings
![Page 3: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/3.jpg)
Downloading Java
![Page 4: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/4.jpg)
Downloading Java
![Page 5: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/5.jpg)
Downloading Java
![Page 6: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/6.jpg)
Downloading Eclipse
![Page 7: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/7.jpg)
Downloading Eclipse
![Page 8: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/8.jpg)
Creating a Java Program With Eclipse
![Page 9: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/9.jpg)
Creating a Java Program With Eclipse
![Page 10: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/10.jpg)
Creating a Java Program With Eclipse
![Page 11: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/11.jpg)
Creating a Java Program With Eclipse
![Page 12: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/12.jpg)
Creating a Java Program With Eclipse
![Page 13: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/13.jpg)
Running a Java Program With Eclipse
![Page 14: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/14.jpg)
Running a Java Program With Eclipse
• Double-click Java Application
![Page 15: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/15.jpg)
Running a Java Program With Eclipse
![Page 16: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/16.jpg)
Running a Java Program Using Command Line
![Page 17: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/17.jpg)
Running a Java Program Using Command Line
![Page 18: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/18.jpg)
Running a Java Program Using Command Line
![Page 19: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/19.jpg)
Running 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
![Page 20: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/20.jpg)
Running a Java Program Using Command Line
![Page 21: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/21.jpg)
Running a Java Program Using Command Line
![Page 22: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/22.jpg)
Running a Java Program Using Command Line
• If you get the error: – Exception in thread "main"
java.lang.NoClassDefFoundError: HelloWorldApp
• Make sure you’re 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=
![Page 23: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/23.jpg)
Java 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)
![Page 24: COP 3330 Notes 1/12. Today's topics Downloading Java and Eclipse Hello World Basic control structures Basic I/O Strings.](https://reader030.fdocuments.net/reader030/viewer/2022032607/56649ec95503460f94bd6852/html5/thumbnails/24.jpg)
Java 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