Netbeans For Mac

As of the release of Java 7 Update 6, you can download and install Java for Mac OS X directly from the. There is no longer a need to get Java updates from the App Store (or from Software Updates). Java for mac When prompted to Open the installation file, click the Open button.5. To download and install Java for Mac OS X, just follow these steps. Java content is common on the Internet.

Apache NetBeans for Mac is easy to install and use straight out of the box and runs on many platforms including Windows, Linux, Mac OS X and Solaris. Java Shell is a new tool included in JDK9 defined in JEP 222 to introduce REPL (read-eval-print-loop) capabilities to Java. NetBeans UML will run on the Mac OS X 10.5 without any performance problems with both JDK 1.5 and JDK 1.6. Current Development. For NetBeans 6.5 the UML drawing area has been completely rewritten. One of the goals for drawing area redesign is to better support the Mac. In the beta release of NetBeans 6.5 UML will be on the update center. How do I make NetBeans recognize my JDK 6 installation on Mac OS X? If you have JDK 6 installed on your machine and NetBeans is not locating the installation, you may need to set the default Java version in the Java Preferences. Java Hello Hello, world from Mac! How to Install JDK on Ubuntu. There are several JDK implementations available for Linux, such as Oracle JDK, OpenJDK, Sun JDK, IBM JDK and GNU Java Compiler. Read 'Writing your first Java program with NetBeans'. NetBeans allow you to debug program graphically. Read 'Debugging program in NetBeans'.

This document providesinformation about downloading, installing, and configuring C/C++ support in theNetBeans IDE. Before you can develop in C/C++, the NetBeans IDE requires theC/C++ plugin module, and third party C/C++ compilers, make utilities, anddebuggers.

Sign in to Cloud. Access your cloud dashboard, manage orders, and more. Sign up for a free trial. NetBeans is a very useful IDE that supports many languages on the Mac. In the first article, John explained how to do the install. Here, in Part II, he shows how to get started writing.

Contents

To follow this tutorial, you need the following software and resources.

Software or ResourceVersion Required
NetBeans IDEversion 7.0 with NetBeans C/C++ plugin
Java Developer Kit (JDK)version 6

Enabling C/C++/Fortran in the IDE

The NetBeans IDE is a dynamic modular IDE, which means you can change it byadding and removing modules of the program. You can add functionality byinstalling plugin modules, or remove functionality by uninstalling plugin modules.See the NetBeans IDE online help for more information about plugins.

If you want to work with C, C++, or Fortran programs in the NetBeans IDE,your NetBeans installation must include the C/C++ plugin.

Although the plugin is named C/C++, it also includes support for Fortranprogramming.

If you have not yet installed NetBeans IDE 7.0

If you have not yetinstalled the NetBeans IDE, download either the C/C++ bundle or theAll bundle from NetBeans IDE7.0 Download Page. If you will not be using other languages such as Java and Ruby,you should download the C/C++ bundle.

If you have NetBeans IDE 7.0 but do not know if you have the C/C++ plugin

If you already have NetBeans IDE, determine if your NetBeans IDE includes theC/C++ plugin already, by selecting File > New Project.If C/C++ is listed as one of the Categories, you have the C/C++ plugin module.You should skip to the section Installing and Setting Up the Compilers and Tools.

If you have NetBeans IDE 7.0 without the C/C++ plugin

If your NetBeans IDE does not show a C/C++ project category when you select File > New Project, complete thefollowing steps to add the C/C++ plugin module to the IDE.

  1. If your network uses a proxy, choose Tools > Options > General in the IDE, select Manual Proxy Settings, enter the HTTP Proxy and Port for your proxy, and click OK.
  2. Choose Tools > Plugins.
  3. In the Plugins dialog box, click the Available Plugins tab, and scroll to the C/C++ category.
  4. Select the C/C++ checkbox and click Install to start the NetBeans IDE Installer.
  5. In the NetBeans IDE Installer, click Next.
  6. Read the license agreement, select the checkbox to accept the terms of the license agreement, and click Next.
  7. Click Install.
  8. After the installation completes, select either Restart IDE Now or Restart IDE Later and click Finish.

Installing and Setting Up the Compilers and Tools

The Netbeans C/C++ module requires a C compiler, C++ compiler,make utility, and gdb debugger. See the following instructions forthe platform of your development system.

- Microsoft Windows
- Oracle Solaris OS
- Linux
- Macintosh OS X

Microsoft Windows

The NetBeans C/C++ module has been tested with compilers from Cygwin andMinGW. If you install both Cygwin and MinGW, be careful to keep their installationlocations completely separate and do not mix tools from Cygwin and MinGW inone tool collection in the IDE.

If you want to use Qt with Windows, you must use MinGW, which is included in the Qt SDK. You should not install MinGW separately.

- Cygwin Compilers and Tools
- MinGW Compilers and Tools

Cygwin Compilers and Tools

The NetBeans C/C++ module has been tested with the following compilersand tools from Cygwin.com.

Software or ResourceVersion TestedDescription
cygwin1.dll1.7.7Cygwin Linux-like environment for Windows
gcc4.3.4Cygwin C compiler
g++4.3.4Cygwin C++ compiler
gdb6.8Cygwin GNU debugger
make3.81Cygwin make utility

If you already have the Cygwin gcc and g++ compilers, GNU make, andgdb debugger installed on your Windows system andyour path is set up correctly to find them, make sure that you have thecorrect versions.

To check the versions of your Cygwin compilers and tools:

  1. Check the version of Cygwin environment by typing the following commands at a Windows command prompt:

  2. Check the versions of the Cygwin gcc and g++ compilers, make, and gdb bytyping the following commands at a Windows command prompt:

If you have the correct versions, then no further setup isnecessary. See Verifying the Installation to verify thatthe tools are installed correctly for the NetBeans IDE.

To install the GNU gcc and g++ compilers, make, and gdb debugger fromcygwin.com:

  1. Refer to the Cygwin User's Guide for complete information about installing and using Cygwin.
  2. Download the Cygwin setup.exe program by clicking Install Cygwin in the left navigation bar, or by clicking this direct setup.exe link.
  3. Run the setup.exe program. Accept the defaults until you reach the Select Your Internet Connection page. Select the option on this page that is best for you. Click Next.
  4. On the Choose Download Site page, choose a download site you think might be relatively close to you. Click Next.
  5. On the Select Packages page you select the packages to download. Click the + next to Devel to expand the development tools category. You may want to resize the window so you can see more of it at one time.
  6. Select each package you want to download by clicking the Skip label next to it, which reveals the version number of the package to download. At a minimum, select
    • gcc-core: C compiler
    • gcc-g++: C++ compiler
    • gdb: The GNU Debugger
    • make: the GNU version of the 'make' utility
    Packages that are required by the packages you select are automatically selected as well.
  7. Click Next to connect to the download site and download the packages you selected, and click Finish when the installation is complete.
  8. Now add the Cygwin compiler directory to your path to enable NetBeans IDE to find the tools collection:
    1. Open the Control Panel:
      - On Windows XP select Start > Settings > Control Panel) and double-click System.
      - On Windows 7, type var in the Start menu's search box to quickly find a link to Edit the system environment variables.
    2. Select the Advanced tab and click Environment Variables.
    3. In the System Variables panel of the Environment Variables dialog, select the Path variable and click Edit.
    4. Add the path to the cygwin-directorybin directory to the Path variable, and click OK. By default, cygwin-directory is C:cygwin. Directory names must be separated with a semicolon. Your edited path should look something like %SystemRoot%system32;%SystemRoot%;C:Program FilesQuickTimeQTSystem;C:cygwinbin
    5. Click OK in the Environment Variables dialog and the System Properties dialog.
    6. See Verifying the Installation to verify that the tools were installed correctlyfor the NetBeans IDE.

MinGW Compilers and Tools

NetBeans IDE 7.0 was tested with Minimalist GNU for Windows (MinGW) and the Minimal System (MSYS) Unix-like environment. Versions tested and installation instructions are shown below.

If you want to use Qt with Windows, you should use the version of MinGW
that is included in the Qt SDK instead of installing MinGW separately.

Software or ResourceVersion TestedDescription
gcc3.4.5MinGW C compiler
g++3.4.5MinGW C++ compiler
gdb7.0MinGW GNU debugger
make3.81MSYS make utility
Note that MinGW make is not supported

To install the GNU compilers, make, and gdb debugger frommingw.org:

  1. Log in to Windows using an account with computer administrator privileges.
  2. Download the self-extracting installer from How To Install the MinGW (GCC) Compiler Suite on mingw.org or for convenience you can download from thisdirect link.
  3. Run the MinGW installer in Windows.
  4. In the MinGW installer, accept the defaults until you get to the Choose Components page.
  5. On the Choose Components page, select the g++ compiler. The gcc compiler is automatically included in the installation so it is not a selectable component.
  6. Do not select MinGW make, as you need to use the make from MSYS instead, which is downloaded separately. Click Next.
  7. Use the default C:MinGW as the destination folder if possible to minimize any potential difficulty with using the compilers from another location.
  8. Click Install to install the MinGW tools, then click Next, then click Finish.
  9. Add the C:MinGWbin directory to your path, as described in Environment Settings in the MinGW wiki.
  10. See the installation instructions for MSYS at the MinGW MSYS wiki. You only need to install the MSYS 1.0 files. You do not need toinstall the DTK or the core files mentioned in the wiki page.
  11. For convenience, you can download from thisdirect link to MSYS-1.0.10.exe
  12. Make sure you are using a Windows account with 'computer administrator' privileges when youinstall MSYS. The NetBeans IDE might have issues when you try to build and run projects later if MSYSis installed under a limited user account.
  13. Run the MSYS-1.0.10.exe installer and accept the defaults.
  14. To install the gdb debugger, download from this direct link to gdb-7.0-2-mingw32-bin.tar.gz. You must have a Windows zip utility such as gzip, 7-zip, or WinZip to extract this gdb archive.
  15. Unzip the gdb-7.0-2-mingw32-bin.tar.gz to your C:MinGW directory so that the gdb executable is installed into your C:MinGWbin directory.
  16. See Verifying the Installation to verify that the tools were installed correctlyfor the NetBeans IDE.

Oracle Solaris OS

On the Oracle Solaris OS, you can use GNU tools or Oracle Solaris Studio tools. The GNU tools are included in Oracle Solaris 10 OS in the /usr/sfw/bin directory by default. The Oracle Solaris Studio software is a suite of developer tools that are free to download. The Oracle Solaris Studio compilers are optimized for Sun hardware, and make it easier to produce performance tuned Oracle Solaris binaries.

NetBeans IDE 7.0 has been tested with the following compilers and tools.

Software or ResourceVersion TestedDescription
cc5.9, 5.10, 5.11Sun Studio 12, Sun Studio 12 Update 1, and Oracle Solaris Studio 12.2 C compilers
CC5.9, 5.10, 5.11Sun Studio 12, Sun Studio 12 Update 1, and Oracle Solaris Studio 12.2 C++ compilers
gcc3.4.3, 3.4.6GNU C compilers
g++3.4.3, 3.4.6 GNU C++ compilers
gdb6.8GNU debugger
gmake3.81GNU make
make3.81Solaris make
dmake7.8, 7.9, 8.0Sun Studio 12, Sun Studio 12 Update 1, and Oracle Solaris Studio 12.2 distributed make utility

Oracle Solaris Studio 12.2 Compilers

If you want to use the Oracle Solaris Studio 12.2 compilers on Solaris 10 OS:

  • If youhave Oracle Solaris Studio 12.2 software installed, ensure that /installationdirectory/solstudio12.2/binis in your path before you start the NetBeans IDE. The default location onSolaris 10 OS is /opt/solstudio12.2/bin
  • If you do not have Oracle Solaris Studio 12.2 software installed, you candownload it free at http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-141149.html.

To download and install the Oracle Solaris Studio 12.2 compilers:

  1. Create a directory for the downloaded file.You must have write permission for this directory.
  2. Download the package installer file for your platform into the download directory.
  3. Go to the download directory, and uncompress and untar the downloaded file.
  4. Follow the instructions in Chapter 2 of the Oracle Solaris Studio 12.2 Installation Guide to install the C compiler, C++ compiler,and required Solaris patches.
  5. Edit your PATH to add the path to the Oracle Solaris Studio 12.2 software beforestarting the NetBeans IDE.
  6. See Verifying the Installation to verify that the tools were installed correctlyfor the NetBeans IDE.

Netbeans For Macbook Air

GNU Compilers and GNU make

If you want to use the GNU compilers and GNU make:

  • If you have a standard installation of the Oracle Solaris 10 OS, the compilers andgmake are installed in /usr/sfw/bin. Make sure that thislocation is in your PATH before starting the NetBeans IDE.
  • If the compilers and gmake are not installed on your system, you can download them fromhttp://www.sunfreeware.com.

To download and install the GNU compilers and make utility

  1. Download gcc and make.
  2. If the download zip files are notautomatically extracted during download, unzip them with gunzip.
  3. Install the packages with the pkgadd command.
  4. Make sure to include the GNUcompiler directory and the GNU make directory in your path before starting the NetBeans IDE.
  5. See Verifying the Installation to verify that the tools were installed correctlyfor the NetBeans IDE.

gdb Debugger

Whether you use the Oracle Solaris Studio compilers and Solaris make or theGNU compilers and GNU make, you must have the gdb debugger todebug applications in NetBeans IDE. You can download gdb fromhttp://www.sunfreeware.com.

To download and install gdb:

  1. Download gdb 6.6 or 6.8.
  2. If the download zip file is notautomatically extracted during download, unzip it with gunzip.
  3. Install the package with the pkgadd command.
  4. Make sure to include the path to gdb in your PATH before startingthe NetBeans IDE.
  5. See Verifying the Installation to verify that the tools were installed correctlyfor the NetBeans IDE.

Linux

On Linux platforms, you can use GNU tools or Oracle Solaris Studio tools.

NetBeans IDE has been tested with the following compilers and tools:

Software or ResourceVersion TestedDescription
cc5.9, 5.10, 5.11Sun Studio 12, Sun Studio 12 Update 1, and Oracle Solaris Studio 12.2 C compilers
CC5.9, 5.10, 5.11Sun Studio 12, Sun Studio 12 Update 1, and Oracle Solaris Studio 12.2 C++ compilers
gcc4.3.3, 4.4.5GNU C compiler in Red Hat Enterprise Linux 5 and Ubuntu 8.04, GNU C compiler in Oracle Linux 6 and Ubuntu 10.10
g++4.3.3, 4.4.5GNU C++ compiler in Red Hat Enterprise Linux 5 and Ubuntu 8.04, GNU C++ compiler in Oracle Linux 6 and Ubuntu 10.10
gdb6.8, 7.2GNU debugger in Red Hat Enterprise Linux 5 and Ubuntu 8.04, GNU debugger in Oracle Linux 6 and Ubuntu 10.10
gmake3.81GNU make in Red Hat Enterprise Linux 5 and Ubuntu 8.04

Oracle Solaris Studio 12.2 Compilers on Linux

If you want to use the Oracle Solaris Studio 12.2 compilers in a Linux OS:

  • If you have Oracle Solaris Studio 12.2 software installed, ensure that /installationdirectory/solstudio12.2/binis in your path before you start the NetBeans IDE. The default locationis /opt/oracle/solstudio12.2/bin when installing with Linux packages.
  • If you do not have Oracle Solaris Studio 12.2 software installed, you candownload it free at http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-141149.html.

To download and install the Oracle Solaris Studio 12.2 compilers:

  1. Create a directory for the downloaded file.You must have write permission for this directory.
  2. If your browser is set to download to a particular location such as your Desktop or a Downloads directory without prompting,set the browser preferences to download to thedirectory you created. For Firefox, the download directory is set in Edit > Preferences > Main.
  3. Download the filefor your platform into the download directory you created. If you are using Ubuntu,download the tarfile installation into the directory where you want to install it because the packages are for Oracle Linux, Red Hat Enterprise Linux, and SuSE Linux Enterprise System. Note alsothat Ubuntu is not an officially supported platform for Oracle Solaris Studio IDE, but the compilershave been tested for use in NetBeans IDE and been found to work.
  4. Go to the download directory, and uncompress and untar the downloaded file.
  5. If you downloaded the SUSE or RPM packages, follow the instructions in Chapter 2 of the Oracle Solaris Studio 12.2 Installation Guide to install the C compiler, C++ compiler, and Fortran compiler.
  6. Edit your PATH to add the path to the Oracle Solaris Studio software beforestarting the NetBeans IDE.
  7. See Verifying the Installation to verify that the tools were installed correctlyfor the NetBeans IDE.

To download and install the GNU debugger in Oracle Linux or Red Hat Enterprise Linux, type:

To download and install the GNU debugger in Ubuntu, type:

Macintosh OS X

NetBeans IDE has been tested with the following compilersand tools:
Software or ResourceVersion TestedDescription
gcc4.2.1GNU C compiler in Mac OS X 10.6
g++4.2.1GNU C++ compiler in Mac OS X 10.6
gdb6.3.5GNU debugger in Mac OS X 10.6
make3.81GNU make in Mac OS X 10.6

Netbeans For Macbook Air


Install the following packages that are provided with your Macintosh OS X:

  • Xcode
  • X11

These packages can also be downloaded fromApple Developer Connection withthe free ADC membership.


Verifying the Installation

To verify that the installation is correct, start the NetBeans IDE, build a sample project, and run it in the gdb debugger.

Start the NetBeans IDE

To start the IDE, do one of the following:

  • Double-click the NetBeans IDE icon on the desktop.
  • On Linux or Solaris platforms, navigate to the bin subdirectory of your NetBeans installation andtype ./netbeans.
  • Launch the NetBeans IDE through the desktop menu.

    This method is available on Windows platforms, but might not be availableon the Solaris 10 OS and some Linux platforms.

Build a Sample Project to Test the Tools

Netbeans Download

On all platforms, you can build a sample project to test the compiler installation,and run it in the debugger to test the gdb installation.

To build a sample project and run it in the debugger:

  1. Open the New Project wizard by choosing File > New Project.
  2. In the Categories panel on the Choose Project page of the wizard, expandthe Samples category and select the C/C++ subcategory.
  3. In the Projects panel, select the Welcome project. Click Next.
  4. On the Project Name and Location page, click Finish.
  5. In the Projects window, right-click the Welcome_1 project andchoose Build. If your compilers and make utility areinstalled correctly and the path to them is set, build output is displayed inthe Output window and the project builds successfully.
  6. Expand the Source Files node of the project and double-click the welcome.cc file to open it in the SourceEditor.
  7. Set a breakpoint by clicking in the left margin of the SourceEditor window next to any line.
  8. Right-click the project and choose Debug. If the gdbdebugger is installed correctly and the path to it is set, gdb startsup, the Debugger tabs are displayed, and the Welcome application runs and stops at the breakpoint.
  9. Choose Debug > Continue to run the application to completion.
  10. If the project doesn't build or debugger doesn't work, see the next section.

Troubleshooting Tool Issues

  1. Select Tools > Options and click C/C++ in the top panel of the Options dialog box.
  2. In the Build Tools tab, look at the Tool Collection list to see if your tool collection is listed.
  3. Select the tool collection if it is listed, and check the paths to the tools. If the Base Directory path is incorrect, you may have made a mistake when setting your path environment variable. Refer back to the instructions for setting the path in the section for your platform in this document, and correct the path if necessary.
  4. If the tool collection is not listed, click Restore Defaults. This will cause the IDE to rescan your environment to look for tools and the tool collection should be found if the path environment variable is correct.
  5. If you are still having an issue, try adding a new tool collection and specifying the path to the tools, as follows:
    1. Click Add below the Tool Collection list.
    2. Browse to the directory that contains the executables for the compilers, debugger, and make utility. This is usually the bin directory.
    3. Select the directory and click Open. The IDE should be able to determine the family of the tools and update the other fields in the dialog box appropriately. If not, an error is displayed.
    4. If the tools are identified correctly, click OK in the Add Tool Collection dialog box. The new collection should be displayed in the list.
    5. Select the new tool collection and click Default to make sure this tool collection is used automatically for new projects.

    If you cannot solve the problem, ask for help at the NetBeans C/C++ User Forum.


Next Steps

Netbeans For Mac High Sierra

To learn quickly how to develop a C or C++ application with the NetBeansIDE, see the C/C++Projects Quick Start Tutorial