Installing a C++/Java IDE on Your MacOS PC
Steven J. Zeil
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 the
clang` 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.
-
The Java Runtime Environment (JRE) allows you to run Java programs that someone else has compiled. This is all you need to run Eclipse. Get it from Oracle here.
-
The Java Development Kit (JDK), also referred to as the Software Development Kit (SDK) includes the JRE plus the Java compiler. Get this here if you are interested in writing programs in Java.
Either way, just download the installer for your PC’s operating system and run it.
3 Install Your IDE
-
Get VSCode here and install it on your PC.
-
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.
-
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?
-
For local C++ development:
- C/C++
- C++ Intellisense
- Better C/C++ Syntax
-
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”.
- Then try downloading this file and creating a new Java project with it.