A Short DOS Presentation Review
PCs before Windows DOS Text based operating system Disk Operating System Text based operating system No mice allowed!
DOS 101 Documents are stored in files Files are stored in directories In the Windows & Mac worlds, these are called "Folders" Directories are stored on disks Usually denoted with an upper case letter, followed by a colon A: B: C:
Getting to DOS
The DOS Window
Before we get started, here are two useful commands While in DOS, this key will allow you to repeat the last action doskey This DOS function remembers all your commands You use the up & down arrow keys to access them
Getting to doskey
Clearing the screen
Getting to the Floppy drive
Looking Around Short File Name Long File Name Size Date/Time Disk Information
Compiling & Running Java
Program Development Integrated Development Environment Many tools available Writing, compile, debugging source code “friendly” Can be expensive Command-line tool Java Development Kit Free!! http://java.sun.com/ Look for most recent version
Edit You can use either a Java IDE, or Windows notepad to develop your code
javac myClassName.java Compile We use DOS and the Java compiler to create bytecode that can be interpreted The command to compile the program There are, of course, many variations on this command. We'll see some over the time, the rest are in the documentation javac myClassName.java
The .java file is plain text We use the file extension here.
When we run javac, the .class file is automatically created
Load, Verify, Execute java myClassName These three phases take place all at once To execute the class file, we type: There are, of course, many variations on this command. We'll see some over the time, the rest are in the documentation java myClassName
We don't use the file extension here!
Saving your output to a text file We would like to save our output to a file We do this from a DOS window using the "redirect" command: java myClassName > myClassNameOUT.txt The “redirect” symbol is the “greater than” symbol on your keyboard – usually located above the period (“.”)
Using your output file Or You can use the DOS command "type" to see what is in your file Note – You can not print directly from DOS in the labs Or You can open WordPad, notepad, or other word processor and read the file directly Using this method, you can also print your file.