Installing a C++/Java IDE on Your MacOS PC

Steven J. Zeil

Last modified: Sep 17, 2021
Contents:

This document will walk you through the process of installing an IDE (Integrated Development Environment) on a MacOS PC that will help you to work with a C++ and/or Java compiler in local development mode.

All software covered in this document is free.

1 C++

g++`` is no longer available as an official Apple distribution. However, you can obtain theclang` C++ compiler, a worthy “competitor” to g++ that has a very loyal following, in a package called “Command Line Tools for XCode” available from Apple’s developer Site.

The gdb debugger is no longer available as part of that distribution, but it will install the lldb debugger instead.

2 Java

If you only want a Java programming environment in MacOS, Eclipse is still worthwhile.

Eclipse itself runs in Java, so you need to have a reasonably up-to-date version of Java on your PC to use Eclipse, even if you are not programming in Java.

VSCode does not require Java, so if you are going to use VSCode (recommended), you do not need to install the Java compiler unless you will be programming in Java.

There are two main Java packages.

Either way, just download the installer for your PC’s operating system and run it.

3 Install Your IDE

  1. Get VSCode here and install it on your PC.

  2. Run VSCode. In a freshly installed state, it does not know how to work with C++ or Java, and it does not know how to do remote development. We’ll fix these limitations by immediately installing some extensions.

    Click on the button to enter the list of extensions.

  3. Use the text box at the top of the left column to search for the extensions you need. Click the small blue “Install” button in the left column to install it.

    What extensions should you start with?

    1. For local C++ development:

      • C/C++
      • C++ Intellisense
      • Better C/C++ Syntax
    2. For local Java development:

      • Java Extension Pack

4 Try It Out

Try it out and make sure that everything is working.

4.1 Trying out VSCode

You should now be able to create C++ projects, edit C++ code, compile it, and debug it.

Try the VSCode exercises from here and here in CS252, skipping the step of connecting to a remote server.


For local Java development, follow these directions starting at “Creating a source code file”.