Installing a C++/Java IDE on Your Own PC
Steven J. Zeil
This document will walk you through the process of installing an IDE (Integrated Development Environment) on your PC that will help you to work with a C++ and/or Java compiler.
All software covered in this document is free.
1 Making Choices
1.1 What Style of Development Do You Want to Do?
There are three major styles of development environment to consider.
1.1.1 Local Development
In this style, you install an IDE, compiler, and debugger on your own (local) PC and to do all your work there.
Advantages:
- If you have a good PC, this is fast and responsive.
- You don’t need a good Internet connection. You may not need to be on-line at all.
Disadvantages:
- If your PC is slow, your tools will be sluggish.
- There’s lots of software to install on your PC, taking up a good chunk of your hard drive.
- If your compiler is a different version than the one used by the instructor, you may sometimes get very different results. It’s possible that code that compiles on your PC will not compile for the instructor, or vice versa.
- If your operating system is different than the one used by the instructor, your compiled code may behave differently for you than it does for your instructor.
If you want to go with local development but don’t like the choices available to your PC’s operating system, another option is to run a virtual machine on your PC. This virtual “guest” will usually run Linux, making any Linux-compatible tools available to you.
1.1.2 Remote Display
In remote display development, we run the IDE, compiler, & debugger on a remote machine (e.g. the CS Linux servers) and have the results displayed on our local PC’s screen using X2Go.
CS252 was devoted to teaching you how to do this with the Dept’s Linux servers.
Advantages:
- If you have a good Internet connection, this is fast and responsive (usually even if your PC is slow).
- You don’t need to install much on your PC – X2Go will do.
- By running on the same CS machines that your instructor is likely to use, you avoid problems of compatibility when your code is graded.
Disdvantages:
- If your Internet connection is slow, everything will feel sluggish and unresponsive.
- If your Internet connection is down, you can’t work at all.
1.1.3 Remote Development
Remote development strikes a middle point between the extremes of running everything on your PC or running everything on the remote machine.
The compiler and debugger are run on the remote machine and do not need to be installed on your own PC.
The IDE, however, is installed and run on your own PC. It communicates with the remote machine via a combination of SSH and SFTP show you your files on the remote machine, let you edit them, and to issue commands to the compiler and debugger on the remote machine.
Advantages:
- If your PC is slow, this will still feel reasonably fast and responsive, because most of the CPU-intensive tasks are done remotely.
- If your Internet connection is slow, this will still feel reasonably fast and responsive, because the amount of information being transferred is relatively small.
- There’s less software to install on your own PC than in local development.
Disadvantages:
- If your Internet connection is down, you can’t work at all.
- There are extra steps involved in starting each work session and in the initial setup of your project.
1.2 What IDE Do You Want?
You can get by without an IDE at all. Tools like emacs
and vim
are near-IDEs. For that matter, you can get by with any text editor and a command line shell (e.g., NotePad and CMD on Windows). But why would you want to?
You may have gotten used to working with Code::Blocks as an IDE in CS150 and CS250, but you were probably directed to this page from a more advanced course in which, typically, Code::Blocks is insufficient.
There are two IDEs that I recommend at present.
- Eclipse is a professional-quality IDE that offers good support for advanced programming, large projects, and for multiple programming languages.
- VSCode is a lighter weight IDE that offers most of the features of Eclipse, but the interface feels less polished and there is a bit more work to do in initially setting up projects. On the other hand, VSCode offers much better support for remote development than Eclipse.
I’ve worked with Eclipse for several years on a daily basis, both for programming and other development tasks, including managing the documents that make up my course websites. More recently, I find myself using VSCode for most work, using Eclipse only for projects that mix together multiple programming languages, something that VSCode does not, in my opinion, support as well.
The choices you have and the process to follow will depend on what operating system your PC is running:
2 Recommended Configurations
2.1 If Your PC runs Windows 10
Windows 10 users have the interesting option of the Windows Subsystem for Linux (WSL), a.k.a., “Bash in Windows”. This is a Linux virtual machine that runs in parallel with your regular Windows operating system but can interact directly with files on your Windows drives and even launch selected Windows programs from the Linux command line. For C++ programming, this is probably the most straightforward way to get a good development environment on a Windows machine. Java programmers are less likely to want to go that route, sticking instead with a native Windows Java compiler.
Local Development | Remote Development | Remote Display | ||
---|---|---|---|---|
Java | C++ | |||
compiler to install | Windows Java | g++ (in WSL) | (none) | (none) |
IDE to install | Eclipse or VSCode | VSCode | VSCode | (none) |
Other software to install | (none) | WSL | OpenSSH | X2Go |
load on local CPU | high | high | low | medium |
load on network | none | minimal | low | high |
instructions | Eclipse, VSCode | here | here (CS252) | here (CS252) |
2.2 If your PC runs Linux
Most Linux distributions will support installing Java, g++
, gdb
, and make
as part of their normal software installation process. Do what you normally do to install any new software package.
For Ubuntu and other Debian-based Linux distributions, you can follow the instructions starting in section 4 here.
2.3 If Your PC runs MacOS (formerly OS/X)
Your options are slightly constrained here compared to Windows. Eclipse does not work, as of when I am writing this, with the MacOS debugger, making it unsuitable for use in C++ development. You could use Eclipse if you were only interested in Java, but this limitation is enough to drop it from my recommended configurations.
VSCode, on the other hand, will work with the MacOS debugger.
Local Development | Remote Development | Remote Display | |
---|---|---|---|
compiler to install | g++, Java | (none) | (none) |
IDE to install | VSCode | VSCode | (none) |
Other software to install | (none) | (none) | XQuartz, X2Go |
load on local CPU | high | low | medium |
load on network | none | low | high |
instructions | here | here (CS252) | here (CS252) |
Mac users also have the option of using Apple’s own XCode as an IDE, but be warned: this is quite large (about 8Gig). It also does not offer direct support for remote development.