CAFE Project

The following window shows Cafe with a project open, just after loading the program. The last project used will normally automatically load at start up.

To start a new project, first use the File menu to close any currently open project.

Next select the New Project option from the same menu. A project selection dialog box will open. Select the Empty Project option and click OK.

You should now have an empty project open. We will first add a .java source file to the project and then save them both.

Use the File menu again and select New File. After typing the code below, you should have a window that looks something like the following.

(The following code may be copied and pasted.)

import java.io.IOException;

public class Lab1 {
    
 static public void main(String[] args) {
    System.out.println("hello world");
    
    try {
        System.in.read();
    }
    catch(IOException e) {
        return;
    }
 }
}

Now select the Save All option in the File menu. It seems for me that this saves the Project. You should always create a new Folder for a new project, you may do this when you are saving. Click the new folder icon after you navigate to where you want to save your work. Rename the folder and then open it before you name and save the project (.vep) document.

Next click the Save Untitled1... option in the File menu. This will save your .java source file. It should save into the new folder you just created. Also note the check box below that Adds this file to your project (it should be checked). The name of your source file must be the same as your public class.

Now we should be ready to compile and run the program.

Click the Execute option in the Project menu. You should get the following after a brief delay. (Compiling and loading the runtime environment takes time dependant on the speed of your computer.)

If this does not work there may be some options that need setting. Use the Project menu and select the Options... item at the end of the menu. The following window should appear.

The Project Type option should be set to Application.

 

The Main Class option should be set to the name of your public class, in this case Lab1.


 

Now you may add more code to your main class or add additional source files to your project. Remember you may only have one public class per source file and each source file must be named the same as the public class (including upper and lowercase letters).