top bar

Difference between revisions of "Using Netbeans"

(Fixed various outdated things.)
(More updates and clarifications.)
Line 2: Line 2:
  
 
<ol>
 
<ol>
<li>Download and install Micro-Manager.</li>
+
<li>Download and install Micro-Manager. We will refer to the installed Micro-Manager directory as <code>$INSTALLDIR</code> below.</li>
<li>Use [http://subversion.tigris.org/ subversion] to download a copy of the latest [http://micro-manager.org/wiki/Micro-Manager_Source_Code Micro-Manager source and 3rdpartypublic]. The two directories should reside in the same parent directory, e.g. <code>projects/micromanager/</code> and <code>projects/3rdpartypublic/</code></li>
+
<li>Use [http://subversion.tigris.org/ Subversion] to download a copy of the latest [http://micro-manager.org/wiki/Micro-Manager_Source_Code Micro-Manager source and 3rdpartypublic]. The two directories should reside in the same parent directory, e.g. <code>projects/micromanager/</code> and <code>projects/3rdpartypublic/</code>. We'll refer to these two directories as <code>$SRCDIR</code> and <code>$THIRDPARTYPUBLIC</code>, respectively.</li>
<li>Download, install and run [http://netbeans.org Netbeans] (the Java SE Bundle is sufficient).</li>
+
<li>Download, install and run [http://netbeans.org Netbeans]. The Java SE Bundle is sufficient if you already have the JDK (Java Development Kit) installed on your computer. Otherwise, you can install the JDK and NetBeans at the same time from [http://www.oracle.com/technetwork/java/javase/downloads/ Oracle's JDK download page].</li>
 
<li>Choose '''File''' > '''New Project...''' >  [Categories] '''Java''' > [Projects] '''Java Project with Existing Sources'''. Press '''Next'''.
 
<li>Choose '''File''' > '''New Project...''' >  [Categories] '''Java''' > [Projects] '''Java Project with Existing Sources'''. Press '''Next'''.
 
<li>Give your project a name. The '''Project Folder''' is best saved outside of the Micro-Manager source directory. Press '''Next'''.</li>
 
<li>Give your project a name. The '''Project Folder''' is best saved outside of the Micro-Manager source directory. Press '''Next'''.</li>
<li>Under '''Source Package Folders''', click '''Add Folder''' at right and browse to <code><micromanager>/mmstudio/src</code>. If you want to develop a plugin, you can also add <code><micromanager>/plugins/*/src</code> at this time. Press '''Next'''.
+
<li>Under '''Source Package Folders''', click '''Add Folder''' at right and browse to <code>$SRCDIR/mmstudio/src</code>. If you want to develop a plugin, you can also add <code>$SRCDIR/plugins/*/src</code> at this time. Press '''Next'''.
 
<li>Include all files ('''**'''). Press '''Finish'''.
 
<li>Include all files ('''**'''). Press '''Finish'''.
 
<li>Right-click your project in the '''Projects''' tab (probably at left) and select '''Properties'''.</li>
 
<li>Right-click your project in the '''Projects''' tab (probably at left) and select '''Properties'''.</li>
<li>Select '''Libraries''' under '''Categories'''. Make sure the '''Java Platform''' matches the version of Micro-Manager you are using (e.g., 64-bit JDK 1.6).</li>
+
<li>Select '''Libraries''' under '''Categories'''. Make sure the '''Java Platform''' matches the version of Micro-Manager you are using (e.g., 64-bit JDK 1.6 - but using a newer Java Platform in NetBeans than the one shipped with Micro-Manager is usually okay).</li>
<li>Under '''Compile''' > '''Compile-time Libraries''', click '''Add Jar/Folder''', select '''Relative Path''' on the right, and add all jars in <code>3rdpartypublic/classext</code>.</li>
+
<li>Under '''Compile''' > '''Compile-time Libraries''', click '''Add Jar/Folder''' and add all jars in <code>$THIRDPARTYPUBLIC/classext</code>.</li>
<li>Click '''Add Jar/Folder''' again and choose <code>MMCoreJ.jar and MMAcqEngine.jar</code> in <code><your_micromanager_installation_directory>/plugins/Micro-Manager/</code>.</li>
+
<li>Click '''Add Jar/Folder''' again and choose <code>$INSTALLDIR/plugins/Micro-Manager/MMCoreJ.jar</code> and <code>$INSTALLDIR/plugins/Micro-Manager/MMAcqEngine.jar</code>.</li>
<li>Select '''Run''' under '''Categories'''. For the <default config>, set the following parameters: <ul><li>'''Main Class:'''  <code>ij.ImageJ</code></li>
+
<li>Select '''Run''' under '''Categories'''. For the <default config>, set the following parameters: <ul><li>'''Main Class:'''  type in <code>ij.ImageJ</code></li>
<li>'''Working Directory:''' <code><your_micromanager_installation_directory></code></li>
+
<li>'''Working Directory:''' type in your <code>$INSTALLDIR</code></li>
<li>'''VM options:''' <code>-Xmx600M</code> (for 64 bit use <code>-Xmx3000M)</code>.</li></ul>
+
<li>'''VM options:''' type in <code>-Xmx600M</code> (for 64 bit use <code>-Xmx3000M)</code>. This sets the maximum memory (megabytes) used by Java.</li></ul>
 
<li>Click '''OK''', sacrifice a goat, and then right-click your project and choose '''Debug'''.
 
<li>Click '''OK''', sacrifice a goat, and then right-click your project and choose '''Debug'''.
 
</li>
 
</li>

Revision as of 14:16, 22 November 2013

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

  1. Download and install Micro-Manager. We will refer to the installed Micro-Manager directory as $INSTALLDIR below.
  2. Use Subversion to download a copy of the latest Micro-Manager source and 3rdpartypublic. The two directories should reside in the same parent directory, e.g. projects/micromanager/ and projects/3rdpartypublic/. We'll refer to these two directories as $SRCDIR and $THIRDPARTYPUBLIC, respectively.
  3. 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, you can install the JDK and NetBeans at the same time from Oracle's JDK download page.
  4. Choose File > New Project... > [Categories] Java > [Projects] Java Project with Existing Sources. Press Next.
  5. Give your project a name. The Project Folder is best saved outside of the Micro-Manager source directory. Press Next.
  6. Under Source Package Folders, click Add Folder at right and browse to $SRCDIR/mmstudio/src. If you want to develop a plugin, you can also add $SRCDIR/plugins/*/src at this time. 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.6 - 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 all jars in $THIRDPARTYPUBLIC/classext.
  11. Click Add Jar/Folder again and choose $INSTALLDIR/plugins/Micro-Manager/MMCoreJ.jar and $INSTALLDIR/plugins/Micro-Manager/MMAcqEngine.jar.
  12. 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: type in -Xmx600M (for 64 bit use -Xmx3000M). This sets the maximum memory (megabytes) used by Java.
  13. Click OK, sacrifice a goat, and then right-click your project and choose Debug.
  14. If the gods are smiling, then Micro-Manager should launch inside ImageJ.

© Micro-Manager : Vale Lab, UCSF 2006-2011 | All Rights Reserved | Contact