Setting up Ptolemy II and Eclipse

Setting up Ptolemy II and Eclipse

These instructions assume you are using Eclipse 3.4 under Windows or Mac OS X. Other ways of setting up and building Ptolemy II are described on the Ptolemy II install page.

Contents of this page:

  • Install Eclipse
  • Eclipse Preferences for Ptolemy II
  • Set up Eclipse for Ptolemy II
  • Simple Debugging Session
  • Optional Extensions
  • Troubleshooting
  • Other local pages:
  • Profiling using TPTP
  • Install Eclipse

    1. Download the latest version of Eclipse from http://www.eclipse.org.
      In June, 2008, we chose Eclipse for RCP/Plug-in Developers, which is 153Mb. The Eclipse for RCP/Plug-in Developers version includes the plugin development environment (PDE), which is needed by the backtrack facility, which is an optional part of Ptolemy II that allows models to restore their old state. If the version of Eclipse that you install does not have the PDE, then there will be build errors, which can be fixed by excluding ptolemy/backtrack/ from the build.
    2. (Windows): Unzip the download file into an appropriate place, such as C:\Program Files, which will create C:\Program Files\eclipse\eclipse.exe.
    3. Finish the installation by running eclipse/eclipse.exe.
      The first time this is run it will complete the installation process.
      After the first run, normal start-up will occur whenever it is started.

    Eclipse Preferences for Ptolemy II

    The default configuration of Eclipse has some difficulties with Ptolemy II, so a few changes are necessary.

    1. (Windows): We will need to change the default memory size for Eclipse because Ptolemy II is a big project. In Windows, create a shortcut to eclipse.exe by going to the directory where Eclipse is installed, right clicking on eclipse.exe and selecting Create Shortcut.

      Then right mouse click on the shortcut and select Properties and change the target to increase the memory allocated by default. E.g., if you installed Eclipse in C:\Program Files\eclipse, then the Target should read:

         "C:\Program Files\eclipse\eclipse.exe" -vmargs -Xmx256M
      
      The maximum memory size will now be 256 megabytes when you restart Eclipse. You may allocate more memory if you wish.

      To add Eclipse to the start menu, right click on the shortcut and select Pin to Start Menu

    2. Eclipse requires some customization to build Ptolemy II and to keep the Ptolemy II coding style. In the steps below, we outline changes to be made in the Eclipse Preferences window.
      Under Windows the Eclipse Preferences window is invoked via Window | Preferences.
      Under Mac OS X the Eclipse Preferences window is invoked via Eclipse | Preferences.
      For each of the changes, hit Apply. When all the changes are done, hit OK, which will close the Eclipse Preferences Window.
    3. By default, Eclipse rebuilds a project when any change is made to a file. This will result in thousands of errors when Ptolemy II is first checked out, and during normal usage, can be annoying because of the pauses it creates. We suggest disabling this feature as follows:
      1. While still in the preferences window
        (Windows: Window | Preferences)
        (Mac OS X: Eclipse | Preferences)
      2. Select General | Workspace
      3. Deselect Build automatically.
      4. Click Apply.

    4. Ptolemy II source files are worked on by many people with different editors. Unfortunately, different text editors interpret tab characters differently, so it is best to use spaces rather than tabs.
      Sadly, the Eclipse developers have chosen to use tabs as spaces, so you must adjust the Eclipse Java Formatter if you plan on contributing code to the Ptolemy II tree.
      Also, it is best if files end with new line characters, so that we can run line oriented scripts on them.
      In addition, we currently do not want the Eclipse Formatter to format comments. We hope to change this policy in the future.
      We handle these changes together:
      1. While still in the preferences window (Window | Preferences).
      2. Expand the Java tree, expand Code Style | Formatter
      3. Under "Active profile", Click on "New..."
      4. In the "New Profile" window, enter "Ptolemy II" into the "Profile Name" entry.
      5. Under "Initialize settings with the following profile", select "Java Conventions [built-in]" (We use Java Conventions over the "Eclipse" setting because the Eclipse style uses tabs.)
      6. Click on "OK" to close the "New Profile" window
      7. A "Profile 'Ptolemy II'" window will appear. Under the "Indentation" tab, change the Tab policy to "Spaces only".
      8. Under the "New Lines" tab, select "at end of file"
      9. Under the "Comments" tab, unselect "Enable block comment formatting"
      10. Click OK.
      11. In the Preferences Window, click Apply.
    5. Ptolemy II uses some features of Java 5.0. In particular, ptolemy/actor/ptalon uses generics, which require Java 5.0 or later.
      Set Eclipse to use Java 5.0 or later source code compliance.
      1. While still in the preferences window (Window | Preferences).
      2. Expand the Java tree, select Compiler
      3. Make sure that Set "Compiler compliance level" is "1.5", "5.0" or later. Note that Java 1.5 is the same as Java 5.0. What we don't want is "1.4" or "4.0".
      4. Click Apply.
    6. Eclipse has very good compiler error/warning. One of the warnings complains if a Serializable class does not have serialVersionUID declared. Since this warning is only useful if you are tightly managing serialization, we turn it off:
      1. While still in the preferences window (Window | Preferences).
      2. Expand the Java tree, select Compiler | Errors/Warning
      3. Under "Potential programming problems", change "Serializable class without serialVersionUID" to "Ignore"
      4. Under "Generic Types", change "Unchecked generic type operation" to "Ignore".
      5. Under "Generic Types", change "Usage of a raw type" to "Ignore".
      6. Click Apply. If you are prompted for a full rebuild, click Yes.
    7. The PtDoc Doclet in $PTII/doc/doclets/PtDoclet.java requires tools.jar, which is only in the Java Development Kit (JDK), not the Java Runtime Environment (JRE). So, be sure that a JDK is selected for building, not a JRE.
      While still in the preferences window
      (Windows: Window | Preferences)
      (Mac OS X: Eclipse | Preferences)
      1. Select Java | Installed JREs
      2. Verify that the checked line corresponds with a JDK, not a JRE.
    8. Click OK in the Preferences window to apply all of the above changes.

    Setting up Eclipse to manage your Ptolemy II development environment

    Eclipse will manage your ptII code tree as a project called the ptII project. There several ways to set up the ptII project,

    1. Eclipse is unaware of the version control aspects of the project.
      If you are downloading the source from major Ptolemy release, and don't want to update regularly or ssh and subversion are blocked by a firewall, then use this choice.
      (No Eclipse Subversion plugin (Subclipse), No Subversion (svn) from the command line)
    2. Eclipse is unaware of the version control aspects of the project, use the shell version of Subversion to update the tree.
      (No Eclipse Subversion plugin (Subclipse), use Subversion (svn) from the command line)
    3. Eclipse is aware of the Subversion aspects of the project. You can use both Eclipse and shell version of Subversion to update the tree.
      (Use both the Eclipse Subversion plugin (Subclipse) and the shell svn command)
    Without Subclipse, you'll need to manage the Subversion aspects in the usual way, i.e. with Subversion commands being submitted to a bash shell. With Subclipse, Eclipse will do all sorts of things to "help" you. Most of these things are good, but there is a learning curve.

    Please choose one of the methods below to set up Eclipse for Ptolemy II.

    1. Eclipse is unaware of the version control aspects of the project. (No Subversion)

    If you are downloading the source from major Ptolemy release, and don't want to update regularly or ssh and subversion are blocked by a firewall, then use this choice.
    1. Download a ptII source tree from http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest
    2. Configure the .classpath and .project files. See .classpath.default. below.
    3. Create the ptII project
      • In File | New | Project, select 'Java project'. In the 'Contents' box, click on 'Create project from existing source' and browse to the PTII directory. Finish.
      • When asked if you want to shift to the Java perspective, click on Yes.

    OR

    2. Eclipse is unaware of the version control aspects of the project, use the shell version of Subversion to update the tree.

    1. Install Subversion:
      • Tortoise SVN - Windows GUI Client
        If you are not installing Subclipse, then choose TortoiseSVN
      • Cygwin - Windows command line client
        If you are more comfortable with a command line, then choose Cygwin. Make sure that you also install Cygwin's Subversion package.
      • To check out the ptII svn repository with read-only access:
        svn co svn://source.eecs.berkeley.edu/chess/ptII/trunk ptII
        

        Note: Most users will select svn:// because they will be accessing the tree with read-only Subversion access.
        If you have an ssh account on source.eecs.berkeley.edu, then check out ptII with read/write access:
        svn co svn+ssh://source.eecs.berkeley.edu/chess/ptII/trunk ptII
        
        Or, if your user id on source.eecs is different than your current user id on your machine:
        svn co svn+ssh://yourID@source.eecs.berkeley.edu/chess/ptII/trunk ptII
        
      • Configure the .classpath and .project files. See .classpath.default. below.
      • Create the ptII project
        • In File | New | Project, select 'Java project'. In the 'Contents' box, click on 'Create project from existing source' and browse to the PTII directory. Finish.
        • When asked if you want to shift to the Java perspective, click on Yes.

    OR

    3. Setting up Eclipse for use with Subversion: Installing Subclipse

    The Subclipse Eclipse plugin adds Subversion to Eclipse. After installation, you can use either Eclipse to manage your project, or the svn from the command line.

    Follow the Subclipse installation instructions. Upgrade users should see the Subclipse update instruction otherwise the automatic update might not work.

    For your convenience, an abbreviated version of the Subclipse instructions are below:

    1. To download Subclipse, in Eclipse, follow these menus Windows: Help | Software Updates | Find and Install | Search for new features to install | New Remote Site.
      Mac OS X: Help | Software Updates | Available Software | Add Site.
    2. Then enter
       
      Name: Subclipse 1.2.x (Eclipse 3.2+)
      URL:  http://subclipse.tigris.org/update_1.2.x
      
    3. In the Update sites to visit window, select Subclipse 1.2.x (Eclipse 3.2+)
    4. Click Finish
    5. In the "Search Results" window, expand the Subclipse 1.2.x (Eclipse 3.2+) tree and check the box next to Subclipse Plugin. If you select all of Subclipse, you may need to install other modules. The Subclipse Plugin is the only Subclipse feature required for accessing the ptII subversion repository.
    6. Click Next, accept the license agreement, click Finish.
    7. In the "Verification" window, click Install All
    8. In the "Install/Update" window, click Yes.

    SSH Configuration.

    If you will be accessing the ptII repository with read/write access, then you will need to do a little more configuration concerning passwords.

    Note: Most users will not need to do this configuration because they will be accessing the tree with read-only Subversion access. Read-only users can skip to Check Out Ptolemy II from the Subversion repository

    To access the ptII repository with read/write access, you will need configure Subclipse to use your password. If don't do this step and you leave the default settings, and have Cygwin ssh installed, then c:/cygwin/bin/ssh.exe window will pop up each time ssh is called.

    The fix is to set Subclipse to use SVNKit Window | Preferences | Team | SVN | SVN interface | SVNKit (Pure Java) | OK

    Setup the Subversion Configuration to Sane setting

    Sadly, Subversion is by default configured with nonsense initial default values for commit times and end of line settings.

    Tell Subversion to use commit times

    In the default settings, if you check out files with subversion, then they will have their modification times set to the current time. This is incorrect:
    1. The ptII tree includes derived files that are generated by Autoconf, JavaCC and Antlr. If the commit times are not preserved, then the source file might have a mod time later than the derived file which means that either the tool must be run or else the build system must touch the derived file.
    2. If the commit times are preserved, the ls -ltr will quickly show which files were changed when

    To change the Subversion configuration, hunt for the .subversion/config file.

    Under Windows with Cygwin, you might find it as $HOME/.subversion/config. Another place to look is c:/Documents and Settings/yourlogin/Application Data/Subversion/config.

    On the Mac, try /Users/yourlogin/.subversion.

    If the directory does not exist, try running svn --version to create the directory.

    Make this change to .subversion/config

    ### Set use-commit-times to make checkout/update/switch/revert
    ### put last-committed timestamps on every file touched.
    use-commit-times = yes
    

    Tell Subversion to automatically set the eol style

    With the default settings, if you use Subversion to add a makefile, then the file will be checked in with binary settings. When the file is checked on out non-Windows platforms, then the file will have \r\n characters, which will break Solaris /usr/ccs/bin/make and cause other problems.

    Find the .subversion/config file and uncomment the enable-auto-props line so that it looks like:

    enable-auto-props = yes 
    
    Also, uncomment the [auto-props] and the section below that sets the properties for the files. Also, set props for at least makefile, *.tcl and *.mk files. See $PTII/doc/coding/svn-config-auto-props.txt for a more complete set of properties. The bottom of the .subversion/config file should look like:
    ### Set enable-auto-props to 'yes' to enable automatic properties
    ### for 'svn add' and 'svn import', it defaults to 'no'.
    ### Automatic properties are defined in the section 'auto-props'.
    enable-auto-props	 = yes
    
    ### Section for configuring automatic properties.
    ### The format of the entries is:
    ###   file-name-pattern = propname[=value][;propname[=value]...]
    ### The file-name-pattern can contain wildcards (such as '*' and
    ### '?').  All entries which match will be applied to the file.
    ### Note that auto-props functionality must be enabled, which
    ### is typically done by setting the 'enable-auto-props' option.
    [auto-props]
    *.MF = svn:eol-style=native
    *.aart = svn:eol-style=native
    *.ac = svn:eol-style=native
    *.am = svn:eol-style=native
    *.apt = svn:eol-style=native
    *.avi = svn:mime-type=video/avi
    *.bat = svn:eol-style=native
    *.bsh = svn:eol-style=native
    *.c = svn:eol-style=native
    *.cat = svn:eol-style=native
    *.cgi = svn:eol-style=native
    *.classpath = svn:eol-style=native
    *.cmd = svn:eol-style=native
    *.cnd = svn:eol-style=native
    *.conf = svn:eol-style=native
    *.config = svn:eol-style=native
    *.cpp = svn:eol-style=native
    *.css = svn:eol-style=native
    *.cwiki = svn:eol-style=native
    *.data = svn:eol-style=native
    *.dcl = svn:eol-style=native
    *.doc = svn:mime-type=application/msword
    *.dsp = svn:eol-style=CRLF
    *.dsw = svn:eol-style=CRLF
    *.dtd = svn:eol-style=native
    *.egrm = svn:eol-style=native
    *.ent = svn:eol-style=native
    *.fn = svn:eol-style=native
    *.ft = svn:eol-style=native
    *.fv = svn:eol-style=native
    *.g = svn:eol-style=native
    *.gif = svn:mime-type=image/gif
    *.grm = svn:eol-style=native
    *.gz = svn:mime-type=application/x-gzip
    *.h = svn:eol-style=native
    *.handlers = svn:eol-style=native
    *.htc = svn:eol-style=native
    *.html = svn:eol-style=native
    *.ico = svn:mime-type=image/x-icon
    *.ihtml = svn:eol-style=native
    *.in = svn:eol-style=native
    *.java = svn:eol-style=native
    *.jmx = svn:eol-style=LF
    *.jpg = svn:mime-type=image/jpeg
    *.jpg= svn:mime-type=image/jpeg
    *.js = svn:eol-style=native
    *.jsp = svn:eol-style=native
    *.junit = svn:eol-style=native
    *.jx = svn:eol-style=native
    *.m = svn:eol-style=native
    *.m4 = svn:eol-style=native
    *.manifest = svn:eol-style=native
    *.mdo = svn:eol-style=native
    *.meta = svn:eol-style=native
    *.mf = svn:eol-style=native
    *.mk = svn:eol-style=native
    *.mod = svn:eol-style=native
    *.mov = svn:mime-type=video/quicktime
    *.mpg = svn:mime-type=video/mpeg
    *.ms = svn:eol-style=native
    *.n3 = svn:eol-style=native
    *.nroff = svn:eol-style=native
    *.patch = svn:eol-style=native
    *.pdf = svn:mime-type=application/pdf
    *.pen = svn:eol-style=native
    *.php = svn:eol-style=native
    *.pl = svn:eol-style=native
    *.pm = svn:eol-style=native
    *.png = svn:mime-type=image/png
    *.pod = svn:eol-style=native
    *.pom = svn:eol-style=native
    *.ppt = svn:mime-type=application/powerpoint
    *.project = svn:eol-style=native
    *.properties = svn:eol-style=native
    *.py = svn:eol-style=native
    *.rb = svn:eol-style=native
    *.rdf = svn:eol-style=native
    *.rnc = svn:eol-style=native
    *.rng = svn:eol-style=native
    *.rnx = svn:eol-style=native
    *.roles = svn:eol-style=native
    *.rss = svn:eol-style=native
    *.schemas = svn:eol-style=native
    *.sh = svn:eol-style=native
    *.sh = svn:eol-style=native;svn:executable
    *.sql = svn:eol-style=native
    *.svg = svn:eol-style=native
    *.tcl = svn:eol-style=native
    *.tgz = svn:mime-type=application/x-compressed
    *.tif = svn:mime-type=image/tiff
    *.tiff = svn:mime-type=image/tiff
    *.tld = svn:eol-style=native
    *.txt = svn:eol-style=native
    *.types = svn:eol-style=native
    *.vm = svn:eol-style=native
    *.vsl = svn:eol-style=native
    *.wsdd = svn:eol-style=native
    *.wsdl = svn:eol-style=native
    *.xargs = svn:eol-style=native
    *.xcat = svn:eol-style=native
    *.xconf = svn:eol-style=native
    *.xegrm = svn:eol-style=native
    *.xgrm = svn:eol-style=native
    *.xhtml = svn:eol-style=native
    *.xhtml2 = svn:eol-style=native
    *.xlex = svn:eol-style=native
    *.xlog = svn:eol-style=native
    *.xls = svn:mime-type=application/excel
    *.xmap = svn:eol-style=native
    *.xml = svn:eol-style=native
    *.xroles = svn:eol-style=native
    *.xsamples = svn:eol-style=native
    *.xsd = svn:eol-style=native
    *.xsl = svn:eol-style=native
    *.xslt = svn:eol-style=native
    *.xsp = svn:eol-style=native
    *.xtest = svn:eol-style=native
    *.xul = svn:eol-style=native
    *.xweb = svn:eol-style=native
    *.xwelcome = svn:eol-style=native
    *.zip = svn:mime-type=application/zip
    .htaccess = svn:eol-style=native
    INSTALL = svn:eol-style=native
    KEYS = svn:eol-style=native
    LICENSE = svn:eol-style=native
    Makefile = svn:eol-style=native
    NOTICE = svn:eol-style=native
    README = svn:eol-style=native
    abs-linkmap = svn:eol-style=native
    abs-menulinks = svn:eol-style=native
    makefile = svn:eol-style=native
    

    See Subversion Users: Re: Setting svn:eol-style

    To set the style on already checked in files, run:

    svn propset svn:eol-style native filename
    

    Check Out Ptolemy II from the Subversion repository

    Below we describe how to set up Eclipse so Eclipse manages the Subversion interaction.

    Eclipse will manage your ptII code tree as a project called the ptII project. Assuming Eclipse is running:

    1. Install Subclipse by following the instructions above.
    2. In Eclipse, add the ptII SVN Repository: Window | Show View | Other | SVN | SVN Repository
    3. In the SVN Repository view, right click, select New and set the url.
      To check out the ptII svn repository with read-only access:
      svn://source.eecs.berkeley.edu/chess/ptII
      

      Note: Most users will select svn:// because they will be accessing the tree with read-only Subversion access.
      If you have an ssh account on source.eecs.berkeley.edu, then check out ptII with read/write access:

      svn+ssh://source.eecs.berkeley.edu/home/svn/chess/ptII
      
      Or, if your user id on source.eecs is different than your current user id on your machine:
      svn co svn+ssh://yourID@source.eecs.berkeley.edu/chess/ptII
      
      Read/write users will be prompted for their source.eecs.berkeley.edu username and password. This typically happens more than once since in case the svn+ssh protocol is being used passwords are not cached.
    4. In the SVN Repository view, right click on trunk and select checkout
      Be sure to check out the trunk not the entire tree, which include all the branches and the trunk.
      Follow the wizard, creating selections as follows:
      • In the "Check Out As" window, use the default, Check out as a project configured using the New Project Wizard, then hit Finish.
      • In the "Select a wizard" window, select Java | Java Project, then hit Next.
      • In the "Create a Java Project" window set "Project Name" to: ptII
      • Click Finish.
      • If you see a Confirm Overwrite Window that says,
        The project you created, ptII, contains resources other than the standard .project file. If any of those resources have the same name and relative location of a resource you are checking out, the local resource will be replaced with the resource from the repository
        then click OK.

    5. Wait for the checkout to finish. Go get coffee.
      Note:If you did not disable build automatically, as suggested above, then Eclipse will build the project and produce thousands of errors. This is not really a problem. You will fix the errors below with the .classpath.default file.

    6. You will want to view the project in the Java perspective. If you aren't already in the Java perspective, select Window | Open Perspective | Java in the menu. By default, Eclipse offers a "Package Explorer" as the main navigation mechanism for the source files. Many developers much prefer to use the "Navigator." To get the Navigator, select Window | Show View | Navigator in the menu. You can now browse the source files.

    7. Find the file in the ptII home directory called .classpath.default and copy it into a new file called .classpath.
      Note that you can use the Eclipse Navigator browse to the .classpath.default file, open the file, copy the contents, open .classpath, paste the contents and save .classpath.
      Or, you can use Windows Explorer or the shell.
    8. In Eclipse, perform a Refresh on the ptII project by Window | Open Perspective | Java    Go to the Package Explorer or the Navigator.
         Right mouse click on the ptII icon and select Refresh.
      Note:If you do not do copy .classpath.default and select "Refresh", then Eclipse will produce thousands of errors. This is not really a problem. It reflects that you probably don't have installed many optional packages that are needed to build subsets of Ptolemy II. You can ignore the errors (not advised, since they will mask errors you make), or you can copy the .classpath.default file and rebuild. Alternatively, you can install the optional packages and run configure.

    9. Build Ptolemy II by selecting Project | Build All. (If Build All is greyed out, then perhaps "Build Automatically" was not disabled and Ptolemy has been built. See above for more about Build Automatically.) You will get many warnings that you can ignore, but hopefully no errors.

    Running Ptolemy II

    1. In the Run menu, select "Run Configurations...".

    2. In the resulting dialog, select "Java Application" and click "New".

    3. In the dialog, fill in the boxes as follows:
      • Name: Vergil
      • Project: ptII
      • Main class: ptolemy.vergil.VergilApplication

    4. Press the Run button.
    The Ptolemy II welcome window should appear.

    You may now wish to read the Using Vergil tutorial.

    Simple Debugging Session

    1. Locate ptolemy/vergil/VergilApplication in the Explorer and double click. Place a breakpoint on the first line of main() by using Run | Add/Remove Breakpoint
    2. Tell Eclipse which class to run with Run | Run. On the Main tab, select the Ptolemy II package and enter ptolemy.vergil.VergilApplication as Main class.
    3. Press the Run button
    4. To debug, quit Vergil, and place a breakpoint in, say, the fire() method of ptolemy.domains.ct.kernel.CTBaseIntegrator. Then Run | Debug, and as above. Open the Lorenz CT demo from the Quick Tour and run it.

    Optional Extensions

    Ptolemy II includes a number of packages that rely on software that you may or may not have installed, such as MATLAB, the Java comm package (for serial port connections), joystick support, Java Advanced Imaging (JAI), the Java Media Framework (JMF), and Java 3D. If you wish to use or extend these features, you will need to perform a few extra steps. These steps require execution of a script called "configure" in the Ptolemy II home directory, which in turn requires (on Windows) installation of Cygwin, a package that offers Unix-like facilities within Windows. You can find instructions for installing Cygwin at http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/cygwin.htm.

    The procedure below will modify the .classpath file that is provided in the version control repository to customize it for the software that you have installed. The procedure is as follows:

    1. Start up Cygwin bash shell.
    2. Set the PTII variable and export it
      Windows:
      export PTII=c:/Program\ Files/yourLogin/workspace/ptII 
      

      Mac:
      export PTII=c:/Users/yourLogin/workspace/ptII 
      
    3. cd to the PTII directory
      cd "$PTII"
      
      Note that we use double quotes around PTII because the value of PTII has spaces in it.
    4. Run configure:
      ./configure
      
      This will create $PTII/.classpath
    5. If you plan on running the Ptolemy II startup scripts in $PTII/bin on the command line, you will probably want to run the following commands within Cygwin bash:
      cd $PTII/bin
      make
      
    6. In Eclipse, perform a Refresh on the ptII project by WindowOpen Perspective | Java
         Go to the Package Explorer or the Navigator.
         Right mouse click on the ptII icon and select Refresh.
      This will cause Eclipse to see the new ptII/.classpath and to build the project (or you may have to manually rebuild if you turned off automatic rebuild).

    Synchronizing with the repository

    1. In the Navigator view scroll/open until you see the resource (directory or file) to be synchronized.
    2. Right click that resource and select Team->Synchronize With Repository...
    3. The Synchronize view should then be visible.
    4. Select the Incoming, Outgoing, or Incoming/Outgoing menu bar icon as appropriate

    Restoring a file from the repository

    1. In the Navigator view scroll/open until you see the resource (directory or file) to be restored.
    2. Right click that resource and select Replace With->Latest From Head.

    Debugging Tcl Tests

    1. Go to Windows -> Open Perspective -> Java.
    2. In Package Explorer, locate ptjacl.jar -> tcl.lang -> Shell.class -> Shell and highlight it.
    3. Go to Run -> Debug...
    4. Select Arguments tag.
    5. In Program arguments, put alljtests.tcl or any individual test tcl file.
      (E.g. SimpleDelay.tcl)
    6. In VM arguments, put -Dptolemy.ptII.dir=your PtII directory
      (E.g. -Dptolemy.ptII.dir=c:\hyzheng\ptII)
    7. Select Local directory, browse to the directory containing the tcl tests.
      (E.g. C:\hyzheng\ptII\ptolemy\domains\de\lib\test)
    8. Select Debug.
    The nice thing of using Eclipse is that you can very easily locate where the exception is thrown by clicking the classes listed in the stack trace. You may further register a breakpoint to do more diagnosis.

    Troubleshooting

    Preferences

    If you have already used Eclipse and you would like to start over with new projects and preferences, remove the workspace directory in the Eclipse directory. The workspace directory will only appear if you have already run Eclipse. Note that removing the workspace directory will cause Eclipse to 'forget' about any projects that you may have set up

    Rebuilding Briefly flashes a window

    If you have problems where clicking on build briefly flashes up a window, look in $PTII/.classpath for and empty exclusion that looks like ||

    If you have problems with the classpath, look in the workspace/.metadata/log file that is in the directory where eclipse is installed. For more information about the .metadata directory, see below.

    Eclipse takes a long time to start up

    If Eclipse takes a long time to start up, then the problem could be a problem in your .metadata file.

    Basically, when eclipse starts up, it might try to update H:/workspace/.metadata . The solution is covered in http://www.eclipse.org/documentation/html/plugins/org.eclipse.platform.doc.user/doc/tasks/running_eclipse.htm: The way I figured this out was by running Norton Antivirus and doing View -> File System Realtime Scan Statistics and then I noticed that my machine was updating H:/workspace/.metadata

    I think I introduced the problem by clicking on the Eclipse.exe binary and selecting Pin to Start Menu. My solution was to remove the Eclipse bogus entry in the start menu and then create a shortcut, change Start in property and then pin that shortcut to my start menu.