| <html> |
| <!-- |
| Copyright (c) 2008-2013, Oracle and/or its affiliates. All rights reserved. |
| --> |
| <head> |
| <title>Using NetBeans IDE on Mac OS X</title> |
| <meta name="description" content="Using the NetBeans IDE on Mac OSX"> |
| <meta name="TYPE" content="ARTICLE"> |
| <meta name="TOPIC" content="GENERAL"> |
| <meta name="AUDIENCE" content="NBUSER"> |
| <link rel="stylesheet" type="text/css" href="../../netbeans.css"> |
| </head> |
| <body> |
| <h1>Using NetBeans IDE on Mac OS X</h1> |
| <p>The following is an overview of useful information that we hope will help you |
| to get NetBeans IDE up and running in Mac OS X. </p> |
| |
| <a name="system"></a> |
| <h2>System Requirements and Installation</h2> |
| <p>For the minimum and recommended hardware configuration, see the <a href="../../community/releases/80/relnotes.html#system_requirements">NetBeans IDE 8.0 Release Notes</a>.</p> |
| <p>For Mac OS X installation instructions, see the <a href="../../community/releases/80/install.html#install_mac">NetBeans IDE 8.0 Installation Instructions for Mac OS X</a>.</p> |
| |
| <a name="issues"></a> |
| <h2>Issues and FAQs</h2> |
| <p>See the following documents for Mac-related issues and FAQs.</p> |
| <ul> |
| <li><a href="../../community/releases/80/relnotes.html#known_issues-installer">NetBeans IDE 8.0 Release Notes</a></li> |
| <li><a href="http://wiki.netbeans.org/NetBeansMacOSX">Running NetBeans IDE on Mac OS X</a></li> |
| </ul> |
| |
| |
| <a name="shortcuts"></a> |
| <h2> Shortcuts on Mac OS X </h2> |
| <p>The IDE has a default set of keyboard shortcuts that you can use to invoke functions. |
| In some cases, the default IDE shortcuts can conflict with default Mac OS shortcuts. |
| In particular, some function keys used by the Mac OS are known to conflict with some default IDE shortcuts. |
| If you find that some keyboard shortcuts are not behaving as expected, you can modify the |
| shortcut for a particular IDE function by choosing NetBeans > Preferences (Cmd-,) from the main menu |
| and clicking Keyboard in the Options window. |
| You can modify the default Mac OS shortcut by opening System Preferences and clicking Keyboard & Mouse. |
| For more, see the Apple Help topic |
| <a href="http://docs.info.apple.com/article.html?path=Mac/10.5/en/8763.html">Using function keys on portable computers</a>.</p> |
| |
| <p>For a list of NetBeans' Source Editor keyboard equivalents on Mac OS X, see the following table:</p> |
| |
| <!--<table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays keyboard shortcuts for scrolling text in the source editor.">--> |
| <table class="margin-around b-all" summary="This table displays keyboard shortcuts for scrolling text in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Scrolling and Selecting<a name="mvpt"></a></th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| |
| <tr> |
| <td class="valign-top">Cmd-[</td> |
| <td>Moves the insertion point to the highlighted matching bracket. Note that |
| this shortcut only works when the insertion point is located immediately |
| after the opening bracket.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Shift-[</td> |
| <td>Selects the block between a pair of brackets. Note that this shortcut |
| only works when the insertion point is located immediately after either |
| the opening or closing bracket.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Ctrl-G</td> |
| <td>Jumps to any specified line.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-A</td> |
| <td class="valign-top">Selects all text in the file.</td> |
| </tr> |
| </table> |
| <br> |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays keyboard shortcuts for modifying text in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Modifying Text<a name="modtxt"></a> </th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Shift-J</td> |
| <td>Opens the Internationalize dialog box that you can use to insert an localized |
| string at the insertion point.</td> |
| </tr> |
| |
| </table> |
| <br> |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays keyboard shortcuts for modifying text in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Code Folding<a name="fold"></a> </th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Minus (-)</td> |
| <td>Collapses the block of code in which the insertion point is currently |
| located.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Plus (+)</td> |
| <td>Expands the block of code which is adjacent to the insertion point.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Shift-Minus (-)</td> |
| <td>Collapses all blocks of code in the current file.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Shift-Plus (+)</td> |
| <td>Expands all blocks of code in the current file.</td> |
| </tr> |
| </table> |
| <br> |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays keyboard shortcuts for modifying text in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Recording Macros<a name="fold"></a> </th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-J then S</td> |
| <td class="valign-top">Initiates the recording of key sequences for a macro. </td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-J then E</td> |
| <td class="valign-top">Stops the recording of key sequence for a macro and opens |
| the Recorded Macro dialog enabling you to name the new macro. </td> |
| </tr> |
| </table> |
| <br> |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays Mac keyboard shortcuts for clipboard operations in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Cutting, Copying, |
| Pasting, and Deleting Text<a name="ccpdtxt"></a> </th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Z</td> |
| <td class="valign-top">Undo. Reverses a series of editor actions one at a time |
| (excluding Save).</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Y</td> |
| <td class="valign-top">Redo. Reverses a series of Undo commands one at a time.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-X</td> |
| <td class="valign-top">Cut. Deletes the current selection and places it on the |
| clipboard.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-C</td> |
| <td class="valign-top">Copy. Copies the current selection to the clipboard.</td> |
| </tr> |
| |
| <tr> |
| <td class="valign-top">Cmd-V</td> |
| <td class="valign-top">Paste. Pastes the contents of the clipbard at the insert |
| point.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Delete</td> |
| <td class="valign-top">Delete. Deletes the current selection.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-E</td> |
| <td class="valign-top">Deletes the current line.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-K</td> |
| <td class="valign-top">Copies the word preceding the insertion point and then pastes |
| it after the insertion point (the insertion point must be in the whitespace |
| preceeding or following a word). Press K multiple times to cycle through |
| preceding words in succession. </td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-L</td> |
| <td class="valign-top">Copies the word following the insertion point and pastes |
| it at the insertion point (the insertion point must be located in the whitespace |
| preceeding or following a word.) Press L multiple times to cycle through |
| consecutive following words.</td> |
| </tr> |
| </table> |
| <br> |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays keyboard shortcuts for searching text in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Searching for Text<a name="searchtxt"></a> </th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px; text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| |
| <tr> |
| <td class="valign-top">Cmd-G</td> |
| <td class="valign-top">Selects the next occurrence of the word found during the search.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-Shift-G</td> |
| <td class="valign-top">Selects the previous occurrence of the word found during the search.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-F</td> |
| <td class="valign-top">Opens the Find dialog box.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-R</td> |
| <td class="valign-top">Opens the Find and Replace dialog box.</td> |
| </tr> |
| </table> |
| <br> |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays Mac keyboard shortcuts for clipboard operations in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Setting Tabs<a name="settabs"></a></th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| <tr> |
| <td class="valign-top">Tab</td> |
| <td class="valign-top">Shifts all text to the right of the insertion point one |
| tab stop to the right.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-T</td> |
| <td class="valign-top">Shifts text in the line containing the insertion point to |
| the right one tab stop.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-D</td> |
| <td class="valign-top">Shifts text in the line containing the insertion point to |
| the left one tab stop.</td> |
| </tr> |
| </table> |
| <br> |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays Mac keyboard shortcuts for clipboard operations in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Modifying Code<a name="modcode"></a></th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| <tr> |
| <td class="valign-top">Ctrl-Spacebar</td> |
| <td>Opens the Java code completion dialog box.</td> |
| </tr> |
| |
| <tr> |
| <td class="valign-top">Shift-Enter</td> |
| <td>Enters the text that is selected in the code completion box into your file.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Ctrl-I</td> |
| <td>Opens the Insert Code pop-up menu.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Ctrl-Shift-I</td> |
| <td>Adds an import statement to the import section of the code when the cursor |
| is over the class name to be imported.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">Shift-Spacebar</td> |
| <td>Adds a space without checking for abbreviations to expand.</td> |
| </tr> |
| </table> |
| <br> |
| |
| <table border="1" cellpadding="5" cellspacing="0" width="600" summary="This table displays Mac keyboard shortcuts for clipboard operations in the source editor."> |
| <tr class="valign-top align-left"> |
| <th class="align-left" scope="col" colspan="2" bgcolor="E7E7E7">Using Bookmarks<a name="usebkmks"></a></th> |
| </tr> |
| <tr> |
| <td class="align-left" scope="col" style="width:140px;text-align:left;"><b>Keys</b></td> |
| <td class="align-left" scope="col"><b>Action</b></td> |
| </tr> |
| <tr> |
| <td class="valign-top">Cmd-F2</td> |
| <td>Sets or unsets a bookmark at the current line.</td> |
| </tr> |
| <tr> |
| <td class="valign-top">F2</td> |
| <td>Goes to the next bookmark.</td> |
| </tr> |
| </table> |
| <br> |
| |
| <br> |
| <div class='greybox'> |
| <p><b>Note:</b><br /> For |
| a complete list of NetBeans IDE keyboard equivalents, check the Keyboard Shortcuts |
| Card by choosing Help > Keyboard Shortcuts Card. Alternately, you can reference |
| the Keyboard Shortcuts section of the NetBeans IDE built-in Help.</p> |
| <p>You can access the Options window on Mac OS X by selecting NetBeans > Preferences (⌘-,) |
| in the main menu.</p> |
| </div> |
| <br> |
| <a name="tips"></a> |
| <h2>Tips & Tricks </h2> |
| |
| <p>The following are some techniques you can use to get more out of NetBeans IDE on Mac OS X.</p> |
| <ul> |
| <li><b>To emulate right mouse click behavior. </b> |
| <p>Use Ctrl-click by pressing and holding the Control button while clicking. |
| Also see issue #32463 regarding right-click emulation on multiple files. |
| </li> |
| <li><b>To specify which JDK to run NetBeans on.</b> |
| <p>Use the --jdkhome <path> option when starting NetBeans. <path> is |
| the root of the JDK installation. The NetBeans installer looks for suitable |
| JDK installations available on user's system and allows you to select the |
| one you want to run NetBeans on. However, the setting may become obsolete |
| when the user installs a new JDK later, or may be inconvenient if you want |
| to run the IDE with another JDK. That's where the <code>--jdkhome</code> switch |
| comes in handy. |
| <p><b>Note:</b> If you want to set the <path> option permanently, you |
| can do so in the netbeans.conf file as described below. |
| <!--<p>For example, netbeans --jdkhome /usr/bin/jdk1.5.0_02--> |
| <li><b>To make custom startup parameters permanent.</b> |
| <p>If you want NetBeans to always start with specific options such as --userdir, |
| --jdkhome, --fontsize, etc., so that you don't have to type them on the command |
| line at every launch, the most convenient way is to add your custom options |
| directly to the NetBeans configuration (<code>netbeans.conf</code>) file. </p> |
| <p>To do this, Control-click the NetBeans application icon and choose Show |
| Package Contents from the contextual menu. In the Finder window that appears, |
| navigate to the <code>Contents/Resources/NetBeans/etc/</code> directory, |
| Control-click <code>netbeans.conf</code>, choose Open With from the contextual |
| menu, and select your preferred text editor. Then add the custom parameters |
| you wish to use and save your changes. </p> |
| <p>The netbeans.conf file can include the following entries:</p> |
| <ul> |
| <li><b>netbeans_default_userdir</b>: the default location and name of the |
| userdir. Note that this entry is only valid in the global configuration |
| file. It cannot be redefined in the local netbeans.conf file, because the |
| launcher already needs to know the location of the userdir when the local |
| netbeans.conf file is being processed.</li> |
| <li><b>netbeans_default_options</b>: any parameters passed to NetBeans or |
| the JVM such as memory configuration parameters, debugging options, --fontsize, |
| various experimental switches, etc.</li> |
| <li><b>netbeans_jdkhome</b>: the default location of the JDK to run NetBeans |
| on. Note that this can be overridden with the --jdkhome switch.</li> |
| </ul> |
| </li> |
| </ul> |
| <a name="info"></a> |
| <h2>More Information</h2> |
| <p>For more information, visit <a href="https://netbeans.org/">https://netbeans.org/</a>.</p> |
| <p>You can also find news, articles, additional modules, and other useful information |
| on the NetBeans project web site. Since NetBeans is an open-source project, |
| the web site also provides access to source code, a bug database, information |
| on creating your own NetBeans modules, and much more. </p> |
| <br> |
| <a name="feedback"></a> |
| <h2>Feedback</h2> |
| <p>If you encounter any Mac OS X-specific problems, please let us know by <a href="../../community/issues.html">filing |
| a bug</a>, but don't forget to specify that you are using the Mac OS X operating |
| system.</p> |
| <p>You can also keep up to date on NetBeans IDE and interact with the NetBeans |
| community by signing up for NetBeans project mailing lists at <a href="https://netbeans.org/community/lists/">https://netbeans.org/community/lists/</a>.</p> |
| </body> |
| </html> |