# Using Netbeans

The following instructions for debugging Micro-Manager’s Java code with NetBeans are intended to work on Windows or Mac. Updated for 2.0.0

1. Download and install a recent Micro-Manager nightly build. We will refer to the installed Micro-Manager directory as $INSTALLDIR below. 2. Download a copy of the latest Micro-Manager source. • Clone the main repository: git clone https://github.com/micro-manager/micro-manager • Initialize all submodules: cd micro-manager git submodule update –init –recursive • We’ll refer to the root source directory as $SRCDIR below.
6. 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. 7. Include all files (**). Press Finish. 8. Right-click your project in the Projects tab (probably at left) and select Properties. 9. 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). 10. 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. 11. 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.