Java Edit

Note: Your program must be named with the extension .java AND the name of the program must be the name of the class.

In ST 1, 124, choose Start->Programs->Instructor Apps->Java Edit. Choose Configure Editor from the Run menu. Then choose External Applications. In the dialog box, be sure the compiler path is:


C:\jdk1.2.2\bin\java.exe

To create the executable, choose New->Project and give the project a name. Then choose New->Java Document and give the file the same name (except this one will have the .java extension. Enter the program and save it before trying to run it in case something goes wrong.

To compile, choose Compile document from the Run menu.

To run, choose Run Java from the Run menu. On the command line, type the name of the program to run. (Example: if your source file is called program1.java, type: program1)

Type control-c (^c-hold down the control key and press c) to close the output window.

If there are errors, you will have to fix them and try again.

If you can't see what's in the output window because it closes automatically, add this code to the bottom of main:

//This forces the computer to wait for input. System.out.println("\nPress any key to continue: "); byte bytes[]= new byte[80]; try { int num=System.in.read(bytes); } catch(java.io.IOException e) { } And be sure to add to the top: import java.io.*

Click here to return to the IT 108 class page


Copyright © 1999-2002 All Rights Reserved