The following instructions for debugging Micro-Manager’s Java code with NetBeans are intended to work on Windows or Mac. Updated for 2.0-gamma
(See also: Writing plugins for Micro-Manager)
- Download and install a recent Micro-Manager nightly build. We will
refer to the installed Micro-Manager directory as
- Use Subversion to download a copy
of the latest Micro-Manager
We’ll refer to the root source directory as
- Download, install and run NetBeans. The Java SE Bundle is sufficient if you already have the JDK (Java Development Kit) installed on your computer. Otherwise, download a JDK from AdoptOpenJDK . Micro-Manager is currently developed with JDK 8.
- Choose File > New Project… > [Categories] Java > [Projects] Java Project with Existing Sources. Press Next.
- Give your project a name. The Project Folder is best saved outside of the Micro-Manager source directory. Press Next.
- Under Source Package Folders, click Add Folder at right and
$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/javaat this time. You can also add plugins later. Press Next.
- Include all files (**). Press Finish.
- Right-click your project in the Projects tab (probably at left) and select Properties.
- 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).
- Under Compile > Compile-time Libraries, click Add
Jar/Folder and add
$INSTALLDIR/ij.jar, as well as all jars in
- Select Run under Categories. For the
, set the following parameters:
#* Main Class: type in
#* Working Directory: type in your
#* VM options: for 64 bit systems, type in
-Xmx600M. This sets the maximum memory (megabytes) used by Java.
If running Micro-Manager 2.0, you also need to supply
- Click OK, and then right-click your project and choose Debug. If all is well, then Micro-Manager should launch inside ImageJ.