Eclipse is unaware of the version control aspects of the Ptolemy II project.

If you are downloading the source from a major Ptolemy release, and don't want to update regularly, or you do not have network access, then use this choice.

For other ways to set up Eclipse and Ptolemy II, see the Setting up Eclipse to manage your Ptolemy II development Environment page.

  1. Download a ptII source tree:
  2. Set up the Eclipse ptII project .classpath for Ptolemy II
  3. If Eclipse is not running, start up Eclipse
  4. In the File menu, select New | Project ..
  5. In the New Project window, select Java | Java project, Click Next.

    Eclipse New Project

  6. In the Create a Java Project window:
    In Project name, enter any project name, ptII is a common choice.
    Uncheck Use default location and browse to the location of the ptII repo
    Hit Finish
    Below is the Create a Java Project window:

    Eclipse Create A Java Project

  7. Click Next.
  8. In the Java Settings window:
    Click on Allow output folders for source folders
    Change the Default output folder to ptII/eclipse

    In Ptolemy II, the $PTII/bin directory contains Ptolemy-specific scripts. Unfortunately, Eclipse wants to write .class files to that directory. In versions of Eclipse before Oxygen, it was possible to import a project have the output directory be the same as the project. Unfortunately, this is no longer possible, so we have Eclipse output files into $PTII/eclipse

    Ideally, we would have a $PTII/.project file that would define the Ptolemy II Eclipse project, which could then be imported. Unfortunately, the format of the .project file does not support having the output files the same as the project.

    Here's the Java Settings window:

    Eclipse Java Settings

    Be sure to change the Default output folder from ptII/bin to a directory that does not exist, such as ptII/eclipse. If the output folder is ptII/bin, then Eclipse will remove the contents of $PTII/bin including $PTII/bin/vergil, which is how Ptolemy II is started from the command line.
  9. Click Finish.
  10. The Setting Build Paths window may appear and ask if you want to remove all the generated resources from the old location 'ptII/bin'. Click No.

    Eclipse Java Settings

  11. The Open Associated Perspective? window will appear. Click Open Perspective.
  12. There will likely be many errors. These are solved in the next step.
    All users should go on to Set up the Eclipse ptII project .classpath for Ptolemy II