top bar

Using IntelliJ

The following instructions for debugging Micro-Manager's Java code with IntelliJ are intended to work on Windows or Mac. Updated for 2.0-gamma

(See also: Writing plugins for Micro-Manager)

  1. Download and install a recent Micro-Manager nightly build. We will refer to the installed Micro-Manager directory as $INSTALLDIR below.
  2. Use git to clone the micro-manager source code [1]. We'll refer to the root source directory as $SRCDIR below.
  3. Download, install and run IntelliJ Community Edition. You may also need to download a JDK from AdoptOpenJDK. Micro-Manager is currently developed with JDK 8.
  4. Choose Create New Project
  5. Name the Project (i.e. Micro-Manager2), and select the JDK (11 may work, but MM is developed with JDK8).
  6. Select the project and right click and find "Open Module Settings (F4)".
  7. Click on "Add Content Root". From $SRCDIR select mmstudio/src/main/java and mmstudio/src/main/resources
  8. In the Project Settings dialog, select "Libraries". Use the "+" button in the second column to add libraries. If you have ant installed and ran 'ant -f buildscripts\fetchdeps.xml before, add $SRCDIR/dependencies/artifacts/imagej, $SRCDIR/dependencies/artifacts/compile. If you did not, you can try adding the plugins/micro-manager directory of your micro-manager installation. You will also need to supply MMAcqEngine.jar and MMCoreJ.jar, which you either build yourself, or that can be found in $INSTALLDIR/polugins/micro-manager. Click "OK"
  9. in the IntelliJ menu, select Run > Edit Configurations. Add new Configuration, type "Application".
    • Main Class: type in ij.ImageJ
    • VM options: type in -Xmx3000M. This sets the maximum memory (megabytes) used by Java .Also add -Dforce.annotation.index=true.
    • Working Directory: type in your $INSTALLDIR
  10. You should now be able to Run and Debug the code.


Note
The components from the installed Micro-Manager can get out of sync with the source code. If you encounter unexpected errors, update to the latest nightly build and the latest source revision.
© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact