Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 2 February 3, 2000. Installing PFE Just unzip the file you download into any directory, such as C:\Program Files\PFE You may right-click on pfe32.exe.

Similar presentations


Presentation on theme: "Lecture 2 February 3, 2000. Installing PFE Just unzip the file you download into any directory, such as C:\Program Files\PFE You may right-click on pfe32.exe."— Presentation transcript:

1 Lecture 2 February 3, 2000

2 Installing PFE Just unzip the file you download into any directory, such as C:\Program Files\PFE You may right-click on pfe32.exe and drag it to your desktop to create a shortcut there.

3 Setting UP PFE Use Options->Preferences to set up: –Associations –Backup Policy –Others you may be interested in Use Options->Default Modes to set up: –Edit Mode Groups (Make one for Java Files) –Edit Modes to set: Input (auto-indent, strip trailing blanks) Language Awareness (use “C”) Text Formatting (Use “Soft Tabs” every 2, 3, or 4 characters; enable text wrapping at column 72 so you can see when lines are too long.)

4 Using PFE When you press Enter after an opening brace (‘{’), the cursor should automatically indent to a new level. Typing a closing brace will return to the previous indentation level. Put the cursor next to a brace, bracket, or parentheses and type Control-B to see the matching item. Press F-11 to compile your Java source file. –Be sure PFE’s current directory is the one containing the file (File->Change to File Directory). Customize keystrokes with Options->Key Mapping

5 JDK Commands javac [-classpath path] [-deprecation] javadoc -d -author -version –Tags: @author @version @param @return @throws java javap appletviewer file name jar [ctx]vf file name

6 javac javac [-classpath path] [-deprecation] –Compiles one or more source files (names end with “.java”) into class files (names end with “.class). –One class file generated for every class or interface defined in the source files. –If a source file refers to a class that has not been compiled yet, that class will be compiled automatically. –If you use an obsolete method you will get a “Deprecated” message. Recompiling with “- deprecation” will give you details about which method(s) are obsolete.

7 javadoc javadoc -d -author -version –Tags: @author @version @param @return @throws –Generates HTML documentation for classes.

8 java –Create a Java Virtual Machine (JVM). A program that simulates a hypothetical CPU There are JVMs for many different real CPUs –Intel Pentium (PC) –Motorola/IBM Power PC (Macintosh G3/G4)) –Compaq Alpha (forbin) –Load the class file named on the command line into the JVM’s memory. –Invoke the main() method in that class.

9 javap –Prints the signature of each method in a class. –Can handle all class files in all directories listed in CLASSPATH.

10 appletviewer appletviewer file name –The file has to be the name of a document that contains an HTML tag. –Used for developing applets without using a browser. Also useful if your browser doesn’t support Java 2.

11 jar jar [ctx]vf –Specify exactly one of c, t, x. c Create a jar file t Test (list the contents of) a jar file x Extract files from a jar file. –v produces “verbose” (wordy) output. –f says that the next thing in the command is the name of the jar file Jar files are really zip files. One or more files compressed and put into a single file.


Download ppt "Lecture 2 February 3, 2000. Installing PFE Just unzip the file you download into any directory, such as C:\Program Files\PFE You may right-click on pfe32.exe."

Similar presentations


Ads by Google