These are simplified instructions for setting up
Eclipse using the source tree.
See eclipse.htm
for instructions about how to set up Eclipse using
the Subversion version control system.
Subversion allows you to get updates from the
Ptolemy development tree. The instructions here
provide access to a static source code tree, such
as what is shipped with the Ptolemy II release.
The instructions below include how to set up Subversion so that it is possible to update the Ptolemy II tree. If you would like to work from a static source tree, such as what is shipped with the release, see the Simple Eclipse Instructions.
These instructions assume you are using Eclipse Indigo 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:
Other local pages:Ptolemy II requires Java 1.6 because ptdb uses javax.swing.GroupLayout. Also, Java 1.5 is past its end of life.
The Oracle (formerly Sun) Java Development Kit (JDK) is preferred.
The IBM JDK will work under Linux.
OpenJDK may work with Ptolemy II, but could have problems with Kepler.
ptolemy/backtrack/ from the build.
Eclipse is available as both 32-bit and 64-bit binaries. Deciding which one to download can be complex.
The basic idea is that to use a 64-bit version of Eclipse, you must have a 64-bit JVM and an operating system that will support 64-bit applications. When in doubt, choose the 32-bit version of Eclipse, it is more likely to work than the 64-bit version.
See below for details.
uname -a. If the result
contains x64, you are running a 64-bit version of Linux and
would select the 64-bit version of Eclipse.. Also,
try java -version. Below is a run on a 64-bit Linux
machine:
-bash-3.2$ uname -a Linux sisyphus.eecs.berkeley.edu 2.6.18-164.11.1.el5xen #1 SMP Wed Jan 6 13:43:33 EST 2010 x86_64 x86_64 x86_64 GNU/Linux -bash-3.2$ java -version java version "1.6.0_21" Java(TM) SE Runtime Environment (build 1.6.0_21-b06) Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode) -bash-3.2$
2010-10-10 11:50:02.263 java[7823:613] java.lang.NullPointerException at apple.awt.CToolkit.postEvent(CToolkit.java:1086) at apple.awt.EventFactoryProxy.forwardEvent(EventFactoryProxy.java:53)The bug happens when running from Eclipse or from the command line. The bug requires UI interactions such as mouse movement or clicking. The bug is probably a threading bug and may only show up on multi-core machines. The downside is that when the bug occurs, the debugging session in Eclipse may become non-responsive.
For further information, see:
http://lists.apple.com/archives/java-dev/2010/May/msg00140.html.
So, at this time, we are recommending the 32-bit version with Java 1.5 and Mac OS X 10.5.
Below are instructions for using the 32-bit version of Eclipse.
These instructions are for Mac OS X 10.5 only. Mac OS X 10.6 and 10.7
should use the 64-bit version of Eclipse
Download
eclipse-rcp-indigo-macosx-cocoa.tar.gz
uncompress it and move eclipse/ into /Applications, which
will create /Applications/eclipse/Eclipse.app.
Firefox Mac OS X Details for 32-bit under Mac OS 10.5:
/Downloads
eclipse-rcp-indigo-macosx-cocoa.tar.gz
which will create the eclipse directory.
eclipse directory to your
Applications directory.
eclipse.ini.
/Applications/eclipse,
find the Eclipse executable and right click (Control + click)
and choose "Show Package Contents".
Contents/MacOS and double click on
eclipse.ini, which will open up the file in TextEdit
-vm /System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home/bin/java
eclipse.ini, see
http://wiki.eclipse.org/Eclipse.ini
Eclipse | About Eclipse
| Installation Details | Configuration.
java.class.version property should be
49.0.
java.vm.name property might
have the string 64 in it.
http://windows.microsoft.com/en-US/windows7/32-bit-and-64-bit-Windows-frequently-asked-questions.
for details.
C:\Program Files, which will
create C:\Program Files\eclipse\eclipse.exe.
eclipse\eclipse.exe is not created, then it could
be that the security policy on your machine is preventing the creation
of .exe files. If this is the case, then try right
clicking on the zip file, select "Properties" and then at the bottom,
hit "Unblock" and then "Apply". Or try running
unzip from the command line.
/Applications/eclipse/Eclipse.app or eclipse/eclipse.exe.
eclipse.exe and a dll executable:
chmod a+x eclipse.exe
eclipse directory.
find . -name *.dll -exec chmod a+x {} \;
Eclipse has the notion of a workspace, which is a collection of
one or more projects. Ptolemy II is a project.
When the "Workspace Launcher" window comes up, either stick with the default
or choose a new directory. Note that the projects can be located outside
of the workspace directory. One caveat is that Eclipse will not permit
the project directory to be a parent of the workspace directory, so placing the
workspace in a subdirectory such as the default location is best.
Click "OK" to create the workspace and open Eclipse.
Below is the Workspace Launcher Window:

Applications/eclipse, drag the
Eclipse.app icon to the Finder Dock on the edge of your
screen. This will give you fast access to starting Eclipse.
eclipse.exe by going to the
directory where Eclipse is installed, right clicking on eclipse.exe
and selecting Create Shortcut.
Pin to Start Menu
eclipse.ini file.
Window | Preferences.
Eclipse | Preferences.
Apply. When all the changes are done, hit
OK, which will close the Eclipse Preferences Window.
in the preferences window
Eclipse | Preferences)
Window | Preferences)
Java | Code Style | Formatter and click
New
ptdb uses javax.swing.GroupLayout
which requires Java 1.6 (aka Java 6.0) or later.
Eclipse | Preferences)
Window | Preferences)
Java | Compiler
Eclipse | Preferences)
Window | Preferences)
Java | Compiler | Errors/Warning
$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.
Eclipse | Preferences)
Window | Preferences)
Java | Installed JREs
Java SE 6.
JVM 1.6.0.
tools.jar must be added the external jars:
Edit | Add External Jars.
c:\Program Files (x86) \Java\jdk1.6.0_23\lib
c:\Program Files\Java\jdk1.6.0_23\libOpen, select tools.jar and then finish.
Eclipse will manage your ptII code tree as a project called the ptII project.
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest
.classpath file to set paths and exclude files.
There are two choices:
.classpath.default to .classpath.
This choice is the simpler choice, but might exclude optional
third party packages.
./configure. This choice is more complex,
especially for Windows users. However, this choice will include
optional third party software that is already installed on your
machine.
.classpath. One solution
is to follow the instructions from:
http://www.macworld.com/article/51830/2006/07/showallfinder.html:
/Utilities/Terminal.app. Enter:
defaults write com.apple.Finder AppleShowAllFiles YES
/Utilities/Terminal.app
cd /Applications/Ptolemy/ptII8.1.devel
cp .classpath.default .classpath
c:\Ptolemy\ptII8.1.devel.
.classpath and select delete.
.classpath.default, select copy.
.classpath.default.
.classpath. with a
trailing dot. The "operating system" will delete the trailing dot.
OR
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.
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.
/Utilities/Terminal.app
cd /Applications/Ptolemy/ptII8.1.devel
$PTII to the location of the source tree:
export PTII=`pwd`
configure executable.
chmod a+x configure
./configure
./configure
make. The workaround is to install Cygwin,
see http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIlatest/cygwin.htm
Start | Run | Cygwin
cd c:/Ptolemy/ptII8.1.devel
Note that if there are spaces in the path name to the directory
where your Ptolemy installation is located, then you should use
double quotes around the path:
cd "c:/Documents and Settings/yourLogin/workspace/ptII"
$PTII to the location of the Ptolemy II source tree:
export PTII=c:/Ptolemy/ptII8.1.develAgain, if there are spaces in the path, use double quotes:
export PTII="c:/Documents and Settings/yourLogin/workspace/ptII"
./configureThis will create
$PTII/.classpath
File | New | Project.

ptII
is a common choice.
/Applications/Ptolemy/ptII8.1.devel

.classpath file was not found. It is best if you exit
Eclipse, create the .classpath file and redo the above steps.

Vergil
ptII
ptolemy.vergil.VergilApplication
You may now wish to read the Using Vergil tutorial.
Run | Add/Remove Breakpoint
Run | Run.
On the Main
tab, select the Ptolemy II package and enter
ptolemy.vergil.VergilApplication as Main class.
Run | Debug, and
as above. Open the Lorenz CT demo from the Quick Tour and run it.
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
If, when building, the Problem tab shows "Assert cannot be resolved", then the problem is that Junit is not being found.
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.
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.