top bar

Using IntelliJ

Revision as of 13:27, 6 March 2020 by Nico (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The following instructions for debugging Micro-Manager's Java code with InetlliJ 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 Import Project
  5. Navigate to mmstudio/src/main/Java inside your Micro-Manager source code repository.
  6. Leave "Create Project from existing sources" selected and click Next.
  1. Name your project, for instance Micro-Manager2. Place the project outside of the Micro-Manager source code repository, for instance: ~\Documents\IntelliJProjects\Micro-Manager2
  1. Under Source Package Folders, click Add Folder at right and browse to $SRCDIR/mmstudio/src/main/java, as well as $SRCDIR/mmstudio/src/main/resources. If you want to develop a plugin, you can also add $SRCDIR/plugins/*/src/main/java at this time. You can also add plugins later. Press Next.
  2. Include all files (**). Press Finish.
  3. Right-click your project in the Projects tab (probably at left) and select Properties.
  4. Select Libraries under Categories. Make sure the Java Platform matches the version of Micro-Manager you are using (e.g., 64-bit JDK 1.8 - but using a newer Java Platform in NetBeans than the one shipped with Micro-Manager is usually okay).
  5. Under Compile > Compile-time Libraries, click Add Jar/Folder and add $INSTALLDIR/ij.jar, as well as all jars in $INSTALLDIR/plugins/Micro-Manager except for MMJ_.jar.
  6. Select Run under Categories. For the <default config>, set the following parameters:
    • Main Class: type in ij.ImageJ
    • Working Directory: type in your $INSTALLDIR
    • VM options: for 64 bit systems, type in -Xmx3000M, otherwise use -Xmx600M. This sets the maximum memory (megabytes) used by Java. If running Micro-Manager 2.0, you also need to supply -Dforce.annotation.index=true.
  7. Click OK, and then right-click your project and choose Debug. If all is well, then Micro-Manager should launch inside ImageJ.
The components from the installed Micro-Manager can get out of sync with the Subversion source. 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