Recent Changes - Search:

Using the Edit Window

<< Edit Window | TOC | Opening a file >>

How to type (paste) in a program and run it.

//Paste the code below into the Edit Window.

class Hello
{

Hello()
{

System.out.println("This program prints out Hello");

}

public static void main(String[] args)
{

new Hello();

}

}

Compiling the program

Click on the "Cmpl" button to compile the program

A file dialog will popup asking you to save the program.
Java programs must be saved before they can be compiled.

The proper file name for the java program

The file name

The file name you choose is VERY IMPORTANT.
The file name must match the class name.

Our class name is "Hello" so the file must be called "Hello.java".

It is VERY IMPORTANT that the class name and the file name agree in every way.
This includes making sure the same letters are capitalized. In our program the 'H' is capitalized. It is common practice for java programmers to capitalize the first letter of class names.

Java file names end with the ".java" extension. This is true in all operating systems.

After typing in the correct file name press the "save" or "ok" button to save the file.

You can also compile by:
Right-clicking in the Edit Window and choosing "Compile".
Pressing the compile shortcut ^M (CTRL + M) or
Clicking on the "Operation" menu, choose "Basic Tools" and then click on "Compile"

Other ways to compile - Using the Edit Window popup menu to compile

Right-click in the Edit Window and choosing "Compile".

Other ways to compile - Using the Edit Window Operation menu to compile

Click on the "Operation" menu, choose "Basic Tools" and then click on "Compile"

An "!" in the Edit Window title indicates an error.
An "*" in the Edit Window title indicates the file is changed but not saved.
The compiling process

The Compile Process Window

All operations (compile, run, applet viewer, etc) display their output into a JMaker process window.

This window shows the command that was used to compile Hello.java. (javac)
It is the same command that you would use if you were working from a command prompt.

The process window would display any errors. In this case the program compiled without errors.

The 'x' in the process window title bar indicates that the process is done.

Running the compiled program

The Run Process Window

After the program successfully compiles you can run the program.
Click on the "Run" button.
All run progress is displayed in the JMaker run process window.

Our example program simply prints "This program prints out Hello" into the run process window.

You can also run a compiled program by:
Right-clicking in the Edit Window and choosing "Run"
Pressing the compile shortcut ^J (CTRL + J) or
Clicking on the "Operation" menu, choose "Basic Tools" and then click on "Run"

Edit - History - Print - Recent Changes - Search
Page last modified on August 08, 2007, at 04:16 PM