Required Software
- Java SDK 1.6: http://java.sun.com/javase/downloads/index.jsp
- JOGL JSR231-1.1.1: https://jogl.dev.java.net/
- Eclipse: http://www.eclipse.org/downloads/ (The following instructions were written for Eclipse Europa unless specified).
Subclipse Installation (SVN Client for Eclipse)
For latest subclipse installation directions, see http://subclipse.tigris.org/install.html.
Eclipse Galileo
- Start Eclipse.
- Open Help > Install New Software.... Click on Add to add the subclipse software site. Enter the URL "http://subclipse.tigris.org/update_1.4.x". Click OK.
- Select the subclipse site in the dropdown box. The software packages will be populated in the package table as shown below. Select all the packages.
- After installation, setup SVNKit (see SVN Configuration ).
Eclipse Europa
- Start Eclipse.
- Open Menu "Help > Software updates > Find and install..."
- Select "Search for new features to install". Click Next.
- Select the Europa discovery site and the SubEclipse update site (add the SubEclipse site via 'New Remote Site' if it isn't present http://subclipse.tigris.org/update_1.2.x/ ). Click Finish.
- Select the features to install:
- Under the "Europa Discovery Site" tree view, select:
- Database Development
- Enabling Features
- Graphical Editors and Frameworks
- Java Development
- Models and Model Development
- Other Tools > Buckminister - Core (Incubation)
- Web and JEE Development
- (DO NOT INSTALL Mylyn)
- Under the "Subclipse 1.2x (Eclipse 3.2+)" tree view, select only:
- Buckminister - Subclipse support
- Click Next and complete the wizard.
Eclipse Setup (SVN Configuration)
- Request a SVN account (sysadm@loni.ucla.edu)
- Enable SVNKit:
- Open Menu "Windows > Preference".
- In the tree view, navigate to "Team > SVN".
- Under "SVN interface", select "SVNKIT (Pure Java)".
- Click OK.
Eclipse Setup (Checking out projects from SVN repository)
- Checkout repository:
- Open Menu "New > Other"
- Select "SVN > Checkout Projects from SVN". Click Next.
- Select "Create a new repository location". Click Next.
- For the URL, enter
svn+ssh://svn.loni.ucla.edu/cvs/MouseBIRN. Click Next.
- If prompted, enter SSH Credentials. Click OK.
- Select the
trunk folders to checkout (common,dlJGraphics, and all mb* projects). Ctrl-click to checkout multiple projects at one time and click Next when done:
-
-
- common/trunk
- dlJGraphics/trunk
- mbManagerCart/trunk
- mbManagerDocking/trunk
- mbManagerGraph/trunk
- mbManagerIO/trunk
- mbManagerIOPlugins/trunk
- mbManagerPlugin/trunk
- mbManagerSerializer/trunk
- mbRegistration/trunk
- mbRegistrationPlugins/trunk
- mbSearch/trunk
- mbSearchPlugins/trunk
- mbSecurity/trunk
- mbSwingExtensions/trunk
- mbViewer/trunk
- mbViewerPlugins/trunk
- mbWorkspace/trunk
- mbWorkspacePlugins/trunk
- mbat/trunk
|
|
|
-
- Under "Choose how to checkout folder", select "Checkout as project in workspace". The "Project name" should be filled in.
- Click Next. Click Finish.
Since the Eclipse configuration files (.classpath and .project) are included in the repository, skip to the next step, setting the CLASSPATH variables (see below). However, if there are problems, you can manually configure the project as follows:
- Configure Package Settings:
- In the "Package Explorer", right-click on the recently created project. Select "Delete". Select "Do not delete contents". Select "Yes".
- Open Menu "File > New > Java Project".
- Enter a "Project name" (referenced in this document as $PROJECTNAME$).
- Select "Create project from existing source".
- Enter location of source code directory checked out from repository. Click Next.
- In the "Java Settings" wizard, change the "Default output folder" to $PROJECTNAME$/classes. Click Finish.
- Configure Build Path for each project:
- Open Menu "Project > Properties" or in the "Package Explorer", right-click on the recently created project. Select "Build Path > Configure Build Path...".
- In the "Libraries" Tab, click on "Add External JARS". Navigate to the MouseBIRN\common folder and select all the .jars. Click Open.
- In the "Projects" Tab, click on "Add" and select the projects that are required to build.
- Click OK to exit Build Path Wizard.
Eclipse Setup (Classpath Variables)
- Open Menu "Window->Preferences->Java->BuildPath". Expand "BuildPath" and select "Classpath Variables".
- To create a new variable, click the "New" button. Enter variable name (ie: MBAT_COMMON) and path (ie: C:\mbat\common ). Click "OK" to finish.
- MBAT Classpath Variables
- MBAT_COMMON (ie: $MBAT_SRC_HOME$\common)
- MBREGISTRATION_PLUGINS_SRC_HOME (ie: $MBAT_SRC_HOME$\mbRegistrationPlugins)
- MBVIEWER_PLUGINS_SRC_HOME (ie: $MBAT_SRC_HOME$\mbViewerPlugins)
- MBSEARCH_PLUGINS_SRC_HOME (ie: $MBAT_SRC_HOME$\mbSearchPlugins)
- MBHIERARCHYEDITOR_ROOT_HOME (ie: $MBAT_SRC_HOME$\mbHierarchyEditor)
Each project may required different CLASSPATH variables so check the compiler errors for "Unbound classpath variable" and define that variable.
Eclipse Setup (Setting Java Compiler to Java 6.0)
- For each project, right-click and select "Properties". Under the "Java Compiler" category in the tree view, deselect "Enable project specific settings".
- Change the default JRE:
- WIN32: Select "Window->Preferences". Under the "Java->Installed JREs" category, select an installed JDK 1.6 (if none are listed, you will need to install Java SDK 1.6).
- MacOS X: Select "Eclipse->Preferences" (or Command + ,). Under the "Java->Installed JREs" category, select an installed JDK 1.6 (if none are listed, you will need to install Java SDK 1.6).
- Java installation folder:
/System/Library/Frameworks/JavaVM.framework/Versions/
Eclipse Setup (Configuring run working directory)
In order to find the plugin folders, you need to configure the working directory for each application with a main() method (ie: mbat3.0 executable or standalone client). The Eclipse setup assumes the plugin folders are located in mbat/dist.
- Open "Run Dialog": Right-click project -> "Run as" -> "Open Run Dialog..." or in the toolbar, select the dropdown menu next to the "Run As" shortcut -> "Open Run Dialog...".
- Select the application to edit in the left panel, under the "Java Application" tree view. Note, the application must have been run at least once to show up. To run the application for the first time, see Running MBAT or Running standalone clients.
- In the "Arguments" tab, in the "Working directory" section, select "Other:". Click on "Workspace...". Expand "mbat" and select the "dist" folder. Click "OK". Note, if the "dist" folder does not appear then either refresh the
mbat project or run the build.xml scripts to create the folder.
- Click "Apply".
Eclipse Setup (Adding a library to buildpath with Classpath Variables)
By adding libraries using classpath variables, the .project and .classpath can be easily distributed. This step is unnecessary unless you are adding a new library to the project:
- Open Menu "Project->Properties->BuildPath". Select the "Libraries" tab.
- Click the "Add Variable..." button. Select a classpath variable. If variable is a folder, click on "Extend" button to select file.
Eclipse Memory Analyzer Setup
The Eclipse Memory Analyzer (http://www.eclipse.org/mat/) plugin helps identify memory usage and memory leaks.
Installing the plugin
The following instructions are for Eclipse Galileo. For details for other versions, see http://www.eclipse.org/mat/downloads.php#0_8_0.
- Help > New Install Software. Click Add. Enter the URL: http://download.eclipse.org/technology/mat/latest/update-site/. Click OK.
- Select the Memory Analyzer package to install.
Creating a heap dump
The Memory Analyzer plugin uses a heap dump to analyze the memory. The easiest method to get a heap dump is to use JConsole, which is part of the JDK tools.
- Run JConsole ($JDKHOME$\bin\jconsole.exe).
- Run application in Eclipse.
- In JConsole, make a New Connection Connection > New Connection. Select Local Process and select the corresponding process for your program (identified by the main class).
- When ready, to get the heap dump, select the MBeans tab. Expand the com.sun.management > HotSpotDiagnostic > Operations tree. In the Operation invocation panel, enter the filename in p0 with extension .hprof (this is the Memory Analyzer file extension). Click dumpHeap. The file is stored in the working directory of the running application.
Using the Memory Analyzer plugin
- To open the heap file in Eclipse, select File > Open File ... and select the .hprof file above. The Memory Analyzer plugin should start running.
- Introductory webinar to using the Memory Analyzer: http://live.eclipse.org/node/520. Click on View Webinar to see the presentation.
- [TODO]: more details on how to get started checking memory leaks here...
Installing JOGL
- Download the appropriate JSR-231 1.1.1 platform release from https://jogl.dev.java.net/.
- Unzip the release build to a folder of your choice (ie: C:\jogl-1.1.1-windows-i586)
- Method #1 (add JOGL dlls to system path)
- Windows: add the JOGL lib folder to the PATH environmental variable (ie: C:\jogl-1.1.1-windows-i586\lib). Note: on Vista, you may have to add it to the root PATH environment variable, not the user level in order for it to work.
- Mac OS X: add the JOGL lib folder to the DYLD_LIBRARY_PATH environmental variable
- Linux: add the JOGL lib folder to the LD_LIBRARY_PATH environmental variable
- Close and restart Eclipse
- Method #2 (add JOGL dlls to Eclipse runtime environmental variables)
- Open "Run Dialog": Right-click project -> "Run as" -> "Open Run Dialog..." or in the toolbar, select the dropdown menu next to the "Run As" shortcut -> "Open Run Dialog...".
- Select the application to edit in the left panel, under the "Java Application" tree view. Note, the application must have been run at least once to show up.
- In the "Environment" tab, select "New" to add a new environmental variable. Set the environmental variables as specified in Method 1.
- Method #3 (set Native Library Path in Eclipse) [this method is not recommended since everytime you update the .classpath or .project files, you will have to configure the native libraries again]
- In Eclipse, under the "mbat" project, expand the "Referenced Libraries"
- Right-click on "gluegen-rt.jar", select "Properties". In the popup windows, select "Native Library" and select "External Folder" to select the path of the JOGL native libraries (ie: C:\jogl-1.1.1-windows-i586\lib)
- Repeat for "jogl.jar"
Misc Preferences Settings
- Improve SVN label decorations performace:
- Open Preferences > Team > SVN > Label Decorations > General tab. Uncheck "Compute deep outgoing state for folders". Select Apply.
- Disable problem reporting as you type (helps improves performance)
- Open Preferences > Java > Editor. Disable checkbox for "Report problems as you type". Select Apply.
- Show heap status (allows you to initiate garbage collection)
- Open Preferences > General. Click on "Show heap status". Click Apply.
- The heap status is shown in the lower right. You can click on the "Trash" icon to start the garbage collecction.
- To clean up Eclipse (cleans up cached properties)
- run Eclipse with "-clean" on command line.