Running a Program

To attach and run a program that is already displayed on the Project card:

  1. Make sure the project is open by double-clicking the project icon in the Project card. (The project name should be visible in the status line above the Source panel.)

  2. Click the Run button above the Source panel.

    If your program is not already compiled, Cosmo Code first compiles the program, attaches it to the debugger, then runs it. However, if the project.class file was removed before launching Cosmo Code, the program is not compiled.

If you have an existing program, you need to make it a project before you can run it.

When you start Cosmo Code from the command-line, you can specify a program (which must be a Cosmo Code project) to attach to the debugger by typing cosmocode classname.class for a Java application or cosmocode filename.html for an applet. This creates a temporary project for use while in Cosmo Code. You can save the project for use in future sessions by choosing Project > Save.

You can run an applet in an applet viewer or in a web browser without attaching it to the debugger.

See Also

Guide to the Cosmo Code Development Environment
12-96*215