top bar

Difference between revisions of "Using Netbeans"

(Update so that the instructions work with the new Ivy dependency fetching.)
(Replace HTML lists with MediaWiki markup. Also spacing items using HTML comments like the Eclipse page.)
Line 3: Line 3:
 
(See also: [[Writing plugins for Micro-Manager]])
 
(See also: [[Writing plugins for Micro-Manager]])
  
<ol>
+
# Download and install a recent Micro-Manager nightly build. We will refer to the installed Micro-Manager directory as <code>$INSTALLDIR</code> below.
<li>Download and install a recent Micro-Manager nightly build. 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]. We'll refer to the root source directory as <code>$SRCDIR</code> below.</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>
+
# 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]. We'll refer to the root source directory as <code>$SRCDIR</code> below.<!--
<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>
+
# 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>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>Right-click your project in the '''Projects''' tab (probably at left) and select '''Properties'''.</li>
+
# Choose '''File''' > '''New Project...''' >  [Categories] '''Java''' > [Projects] '''Java Project with Existing Sources'''. Press '''Next'''.
<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''' and add all jars in <code>$INSTALLDIR/plugins/Micro-Manager</code> ''except for'' <code>MMJ_.jar</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>
+
# Give your project a name. The '''Project Folder''' is best saved outside of the Micro-Manager source directory. Press '''Next'''.
<li>'''Working Directory:''' type in your <code>$INSTALLDIR</code></li>
+
<!--
<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'''.
+
# 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>
+
<!--
 
+
-->
If the gods are smiling, then Micro-Manager should launch inside ImageJ.
+
# Include all files ('''**'''). Press '''Finish'''.
</ol>
+
<!--
 +
-->
 +
# 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.6 - 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 all jars in <code>$INSTALLDIR/plugins/Micro-Manager</code> ''except for'' <code>MMJ_.jar</code>.
 +
<!--
 +
-->
 +
# Select '''Run''' under '''Categories'''. For the <default config>, set the following parameters:
 +
<!--
 +
-->
 +
#* '''Main Class:'''  type in <code>ij.ImageJ</code>
 +
<!--
 +
-->
 +
#* '''Working Directory:''' type in your <code>$INSTALLDIR</code>
 +
<!--
 +
-->
 +
#* '''VM options:''' type in <code>-Xmx600M</code> (for 64 bit use <code>-Xmx3000M)</code>. This sets the maximum memory (megabytes) used by Java.
 +
<!--
 +
-->
 +
# Click '''OK''', sacrifice a goat, and then right-click your project and choose '''Debug'''.
 +
<!--
 +
-->
 +
#: If the gods are smiling, then Micro-Manager should launch inside ImageJ.
  
 
Note that 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.
 
Note that 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.
  
 
{{Programming_Sidebar}}
 
{{Programming_Sidebar}}

Revision as of 16:46, 6 July 2015

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

(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 Subversion to download a copy of the latest Micro-Manager source. We'll refer to the root source directory as $SRCDIR below.
  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 $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: type in -Xmx600M (for 64 bit use -Xmx3000M). This sets the maximum memory (megabytes) used by Java.
  12. Click OK, sacrifice a goat, and then right-click your project and choose Debug.
    If the gods are smiling, then Micro-Manager should launch inside ImageJ.

Note that 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