Eclipse For Mac Os



In this tutorial, we will learn how to install eclipse IDE on Mac OS X. Eclipse IDE (Integrated development environment) is written in Java and mostly used for developing Java applications. In Eclipse IDE, you can write, compile and run your Java code. Download and install Eclipse. Introducing Eclipse 3: a lean, mean, 100 percent PowerPC native screen saving machine that works great on 68K Macs as well. To eliminate the problem of.

Creating a C++ application using the Standard Template Library and the CDT

  • Download the Eclipse Installer. Eclipse is hosted on many mirrors around the world.
  • 111 time-saving Hotkeys for Eclipse. Extensive, exportable, wiki-style reference lists for Keyboard Shortcuts/Hotkeys.

This article, which is a follow-up to 'C/C++ development with the Eclipse Platform,' is intended for C++ developers who want to learn C++ development using the Eclipse CDT. A simple C++ application is developed in the article. The application makes use of the C++ STL. Readers should be familiar with the STL, as well as with basic object-oriented programming principles such as inheritance and polymorphism. A familiarity with Eclipse will be helpful, but is not required.

Before we start

You need to install the following:

  • Eclipse

    We're using the CDT, which is a plug-in to Eclipse, so of course you need Eclipse. The article uses Eclipse V3.2.

  • Java Runtime Environment

    We're building a C++ application, but we're using Eclipse. Eclipse is a Java application itself, so it needs a Java Runtime Environment (JRE). The article uses Eclipse V3.2, which requires a JRE of V1.4 or higher. If you want to also use Eclipse for Java development, you'll need a Java Development Kit (JDK).

  • Eclipse C/C++ Development Toolkit (CDT)

    This article is about the CDT, so you'll need it, of course. For instructions on installing the CDT on early versions of Eclipse, read a 'C/C++ Development with the Eclipse Platform' (developerWorks 2003) .

  • Cygwin

    If you're using Microsoft Windows®, you will find Cygwin — which provides a Linux®-like environment on Windows — helpful.

  • GNU C/C++ Development Tools

    The CDT uses the standard GNU C/C++ tools for compiling your code, building your project, and debugging the applications. These tools are GNU Compiler Collection (GCC) for C++ (g++), make, and the GNU Project Debugger (GDB). If you're a programmer using Linux or Mac OS X, there's a pretty good chance these tools are installed on your machine. The article contains instructions for setting up these tools for Windows.

Eclipse For Mac Os

The Eclipse CDT

The Eclipse CDT is an Eclipse plug-in that transforms Eclipse into a powerful C/C++ IDE. It was designed to bring many of the great features Eclipse enjoyed by Java developers to C/C++ developers, such as project management, integrated debugging, class wizards, automated builds, syntax coloring, and code completion. When Eclipse is used as a Java IDE, it leverages and integrates with the JDK. Similarly, the CDT leverages and integrates with standard C/C++ tools, such as g++, make, and GDB. This has lead to it becoming very popular on Linux, where those tools are readily available and used for most C++ development. The CDT can be set up on Windows to use the same tools. There is also an ongoing effort to get the CDT to work with Microsoft's C++ tools to make it even more attractive to Windows C++ developers.

Installing the CDT

We start by assuming you installed Eclipse and can run it. If not, consult Eclipse's Web site for getting up and running. Let's install the CDT. The CDT is an Eclipse plug-in, so it uses Eclipse's Software Updates feature. Select Help > Software Updates > Find and Install.

Figure 1. Eclipse Software Updates

Next, you'll want to choose Search for new features to install.

Figure 2. Search for new features

If you're using a newer version of Eclipse, the Callisto or Europa discovery sites should be included. (Editor's note: Since this was written in April 2007, the Europa release was still in the planning stages. However, installing Europa is expected to be similar to Callisto.) Simply select it and click Finish.

Eclipse For Mac Os

Figure 3. Callisto Discovery Site

Eclipse might ask you to choose from a list of mirror sites for the Callisto Discovery Site. Pick whatever one seems closest to you. You should see a list of plug-ins from the Callisto Discovery Site. You'll want to select C and C++ Development and click Next.

Figure 4. Available Callisto plug-ins

You'll be asked to accept the license for the CDT. Once you've done that, you can click Next. You'll see a summary of what's going to be downloaded and installed. Simply click Finish.

Figure 5. Download and installation summary

Eclipse's Update Manager will then download the CDT plug-in from the mirror site you selected earlier. The CDT is about 11 MB total, so this could take a few minutes, depending on your Internet connection speed. Once everything is downloaded, you'll be asked to confirm that you want to install the new features. Click Install All.

Figure 6. Confirm installation

After you finish installing CDT, you'll be asked to restart Eclipse. Go ahead and do that. Once Eclipse restarts, the CDT will be ready to go.

Windows configuration

If you're running Eclipse on Linux or Mac OS X, you're ready to start using the CDT to develop a C++ application. If you're on Windows, there might be a few more steps. As mentioned, CDT relies on the standard GNU C++ development tools: g++, make, and GDB. These are usually included on Linux or Mac OS X. They're usually not included with Windows. But don't worry. These tools can be easily installed on Windows. Perhaps the easiest way is to install Cygwin. Cygwin provides Linux-like environment on Windows (see Related topics). When installing Cygwin, you'll be asked to pick the packages you want to install. Make sure to go into the development section and select gcc: g++, make, and GDB. This will cause their prerequisites to be installed, too.

Once you're done installing Cygwin, you'll need to add g++, make, and GDB to your path. The easiest way to do this is to add Cygwin's bin directory to your path, since that's where g++, make, and GDB can be found. Once that's done, restart Eclipse.

Playing the lottery

At this point, we should be ready to start developing our application with CDT. Let's pause to figure out what we want to develop. The sample application is a simple command-line program for generating lottery numbers. Many states have lotteries, and the rules vary quite a bit. We'll allow the user to pick which state lottery he wants to generate numbers for. This will provide us a good way to use C++'s support for polymorphic behavior.

Creating the project

Eclipse uses the concepts of perspectives to allow for various plug-ins to customize their commands and views. Eclipse starts off by default in the Java perspective. CDT includes its own perspective, so we'll want to switch to that. To do that, select Window > Open Perspective > Other. You should see a list of perspectives available to you. Select the C/C++ perspective and click OK.

Figure 7. Select C/C++ perspective

Eclipse should now look something like Figure 8.

Figure 8. The C/C++ perspective

Eclipse organizes your code into projects, so we'll want to create a new project. Select File > New > Managed Make C++ Project.

Figure 9. New C++ project

You might have noticed there were several different options for the project. We wanted a C++ project. We selected a 'Managed Make,' since that will allow Eclipse to create the make file for us. You could select a 'Standard Make' flavor and write your own make file. We should now be in the New Project wizard, where we'll name our project Lottery and click Finish.

This will create an empty project, which you should see in the C/C++ Projects window. Right-click on the project and select New > Source Folder. This will bring up the 'New Source Folder' wizard, where we'll name our folder src and click Finish.

Eclipse For Mac Os

Basic lottery

We're ready to start creating some code. We'll start by creating the executable of our application. Right-click on the source folder we just created and selected New > Source File, as shown in Figure 10.

Let's create an empty main method for now. This is just a placeholder; we'll add more to this after we've created the rest of our project.

Save your project, and Eclipse will make it for you automatically. You should see some output in the console indicating that it compiled successfully.

We're ready to create our first class. Right-click on the source folder we just created and select New > Class.

Figure 10. New class

This should bring up the New Class wizard. We'll give our class a namespace lotto, and we'll call our class Lottery.

Figure 11. Lottery class

Eclipse will now create stubs for your class. CDT does a lot of nice things for you. It generates the appropriate compiler directives in the header file. It encourages best practices by generating separate interface (Lottery.h) and implementation (Lottery.cpp) files. It encourages another best practice by making your class' destructor virtual. We can enter the source code for these classes as seen in Listings 1 and 2.

Listing 1. Lottery.h

Listing 2 shows the implementation file for the Lottery class.

Eclipse c++ mac
Listing 2. Lottery.cpp

What's this code doing? Well, our Lottery class has two attributes. The ticketSize attribute is the number of numbers on the lottery ticket. The maxNum is the maximum number on the ticket. Later, we'll use the Florida state lottery as an example. There, you pick six numbers from 1 to 53, so ticketSize would be 6 and maxNum would be 53.

The generateNumbers method generates an array of numbers corresponding to the numbers on a lottery ticket. It uses the STL function rand() to generate numbers randomly. The allNums array is used to keep track of what numbers have been generated so far, so we can make sure we don't get a duplicate number on our ticket. Finally, the printTicket() creates a string representation of our ticket.

When you save the files, Eclipse builds your project automatically. Again, if you save the project, it should be compiled and you should see compilation messages in the console, as shown in Listing 3.

Listing 3. Compiler output in console

MegaLottery class

You might have noticed that we made the printTicket() method virtual when it was declared in the header file. That will allow us to subclass Lottery and override this method. We wanted to do that because some states have a lottery with a 'mega' number. This is a separately drawn number that any ticket must match in addition to the other numbers drawn. Let's create a MegaLottery class for these states that will subclass Lottery.

Once again, right-click on our source folder and select New > Class, as we did earlier. This time in the New Class wizard, we'll declare our new class in the same namespace, but call it MegaLottery.

Figure 12. MegaLottery class

To subclass Lottery, select the Add button next to the Base Classes section. This will bring up the Choose Base Class dialog. You can start typing the name of the class, and Eclipse will narrow the list of base class candidates quickly. You'll want to select Lottery and click OK.

Figure 13. Choose base classes

We can enter the code for MegaLottery, as shown in Listings 4 and 5.

Listing 4. MegaLottery.h

Listing 5 shows the implementation file for the MegaLottery class.

Listing 5. MegaLottery.cpp

The main difference between Lottery and MegaLottery is that MegaLottery has an extra attribute maxMegaNum. This is the max value that the mega number can take. It overrides the printTicket() method. It uses the base class to generate the first part of the ticket, then it generates the mega number and appends it to the string representation of the ticket.

We just need a way to create the various lotteries. We'll use a class Factory Pattern to do this. We'll do this by adding a LotteryFactory class. We want all Lotteries to come from the same factory, so we'll make LotteryFactory a singleton. The code for it is in Listings 6 and 7.

Listing 6. #ifndef LOTTERYFACTORY_H_

Listing 7 shows the implementation file for the LotteryFactory class.

Listing 7. LotteryFactory.cpp

The LotteryFactory has an enum of the different types of lotteries. We've only put in Florida and California in the example, but it shouldn't be hard to add as many as you want. The LotteryFactory's constructor seeds the rand() function used by our lottery classes. We just need to implement our executable's main method.

Listing 8. Main.cpp

Running the program

We're ready to run our program. Select Run > Run.

Figure 14. Choose base classes

Select C/C++ Local Application and click the New button.

Figure 15. New C/C++ run profile

This will bring up the Create run configuration interface for the Lottery project. You'll need to select its executable by clicking the Search Project button.

Figure 16. Search project for executable

You can select the binary that Eclipse created for you and click OK.

Figure 17. Search project for executable

Just click Run, and the program should run in your console. The code below shows some sample output.

Debugging the program

Our program should run fine, but let's take a look at debugging the application. First, create a breakpoint in our code. Pick a line and right-click next to it and select Toggle Breakpoint.

Figure 18. Create breakpoint

We need to create a debug configuration, much like we created a run configuration. Select Run > Debug.

Figure 19. Create debug configuration

This should bring up the Debug configuration. This is based on the Run configuration, and you shouldn't need to change anything. Just click Debug.

Figure 20. Debug configuration

Once the debugger starts, it will prompt you to switch to the Debugger perspective. Do so. Notice that in the configuration we set things to break automatically at the startup of our main method. Thus, the debugger should break immediately and you should see a screen something like Figure 21.

Figure 21. The debugger

Eclipse C++ Windows

Summary

We've built and debugged our lottery application. You can easily add more lottery schemes to it. Some of these could involve additional subclasses. CDT makes it easier than ever to create these classes and class hierarchies, and to run and debug the application to test it.

Downloadable resources

Eclipse C++ For Mac Os

Related topics

  • Integrate an external code checker into Eclipse CDT (Alex Ruiz, developerWorks): Learn how to execute C/C++ code analysis tools with Codan in Eclipse.
  • Get an overview of the CDT in 'C/C++ development with the Eclipse Platform.'
  • Dig deep into the CDT's architecture in the five-part series titled 'Building a CDT-based editor.'
  • As someone interested in C/C++ development, you might want to check out a trial of IBM's XL C/C++ compiler for Linux or AIX®.
  • Windows developers can learn about migrating to the CDT in 'Migrate Visual Studio C and C++ projects to Eclipse CDT.'
  • Windows developers can also check out the CDT-MSVC project, a project for incorporating Microsoft's compiler and debugger with CDT.
  • Learn about MinGW, the GNU C/C++ tools for Windows included with Cygwin.
  • Download Cygwin a Linux-like environment for Windows. It consists of two parts: A DLL that acts as a Linux API emulation layer providing substantial Linux API functionality and a collection of tools that provide a Linux look and feel.
  • The Eclipse C/C++ Development Toolkit (CDT) download information contains the latest information about the available versions of CDT.
  • Check out the 'Recommended Eclipse reading list.'
  • For an introduction to the Eclipse platform, see 'Getting started with the Eclipse Platform.'

Install Python before installing Eclipse.

You may want to print these instructions before proceeding, so that you can refer to them while downloading and installing Eclipse. Or, just keep this document in your browser. You should read each step completely before performing the action that it describes. This document shows downloading and installing Eclipse (Luna). You should download and install the latest version of Eclipse. The current latest (as of Fall 2018) is Eclipse 2018-09.

Eclipse: Luna

The Eclipse download requires about 200 MB of disk space; keep it on your machine, in case you need to re-install Eclipse. When installed, Eclipse requires an additional 200 MB of disk space.

Eclipse for mac os sierra

Downloading

  1. Click Eclipse

    The following page will appear in your browser. In this handout we will download Eclipse Standard 4.4 for Mac OS. The version you should download is Eclipse IDE for Eclipse Committers.

    It is critical that Java, Python, and Eclipse are either all 32 Bit or are all 64 Bit (and only if your Machine/OS supports 64 Bit): I think it easiest on Macs to use 64 Bit for everything.

  2. Click the 64-bit after Mac Cocoa for your machine, to the right of Eclipse Standard 4.4 (right under Eclipse Luna R Packages).

    You will see the following page (don't worry about the name of the institution to the right of the big downward pointing arrow).

  3. Click the big downward pointing arrow underneath the Download eclipse-standard-luna-R-macosx-cocoa-x86_64.tar.gz from: The site named here, in purple to the right of the arrow: [United States] ibiblio (http) is the random one chosen by the download page this time; yours may differ.

    If you see the following pop-up window

    ensure the Save File radio button is depressed and click OK.

    This file should start downloading in your standard download folder. This file is about 200 Mb so it might take a while to download fully if you are on a slow internet connection (it took me a few minutes over a cable modem). Don't worry about the exact time as long as the download continues to make steady progress.

    After the download has finished, terminate the window browsing the Eclipse download.

  4. Move this file to a more permanent location, so that you can install Eclipse (and reinstall it later, if necessary).
  5. Start the Installing instructions directly below.

Installing (for Python)

Eclipse For Mac Os Sierra

Python and Java should be installed before installing Eclipse

Eclipse For Macos High Sierra Download

Eclipse For Mac Os
  1. Unzip eclipse-standard-luna-R-macosx-cocoa-x86_64.tar.gz by double-clicking it.

    Unzipping this file creates a folder named eclipse; unzipping 200 MB can take a few minutes. You can leave this folder here or move it elsewhere on your hard disk.

  2. Create an alias on the desktop to to the eclipse file in this eclipse folder:
    On the Mac, you can
    • Control-click the file eclipse.exe
    • Select the Make Alias option.
    • Move it to the desktop.

    Now you are ready to perform a one-time only setup of Eclipse on your machine.

  3. Double-click the alias to Eclipse that you just created above.

    If the following pop-up window appears

    click Open.

    The following splash screen will appear

    and then a Workspace Launcher pop-up window will appear.

    In the Workspace text box, your name should appear between /Users and /Documents, instead of ellenolshansky (I did this on my wife's Mac).

    In this turial, I click in Install ( I have a serial number ). Photoshop cs6 download for free mac. Languages: Danish, Dutch, Finnish, French, French—Canada, German, Italian, Norwegian, Portuguese—Brazil, Spanish, Spanish—Latin America, Spanish—North America, SwedishLanguages: Czech, French—North Africa, Hungarian, Middle Eastern English Arabic, Middle Eastern English Hebrew, Polish, Romanian, Russian, Turkish, UkrainianLang: Chinese Simplified, Chinese TraditionalLinkdown:Lang: KoreanInstruction install Photoshop CS6Step 1: You can use trial version or licence version to try.

    Leave unchecked the Use this as the default and do not ask again box. Although you will use this same workspace for the entire quarter (checking projects in and out of it), it is best to see this Workspace Launcher pop-up window each time you start Eclipse, to remind you where your workspace is located.

    In fact, it is a good idea to create on your desktop an alias to your workspace folder; but you must click OK (see below) before Eclipse creates this folder and you can alias it.

  4. Click OK.

    Progress bars will appear as Eclipse loads.

    Eventually the Eclipse workbench will appear with a Welcome tab covering it.

  5. Terminate (click X on) the Welcome tab.

    You will not see the Welcome tab when you start Eclipse again, after this first time.

  6. Click Help (on the far right of the top toolbar) and then click Install New Software.. in its pull-down menu, as shown below.

    The Install pop-up window will appear.

  7. Enter the text (or cut/paste from this document) http://pydev.org/updates into the Work with text box and press Enter (if that doesn't work, try http://www.pydev.org/updates).

    In a few seconds the information under Name should change from
    There is no site selected to Pending to

    Select only the top PyDev checkbox; do NOT select the PyDev Mylyn Integration (optional) box.
    Check before proceeding that the Install pop-up window appears as

  8. Click Next >

    A new Install pop-up window will appear.

  9. Click Next >

    A new Install pop-up window will appear.

    Application android file transfer for mac. Selecet the I accept the terms of the license agreement radio button, so the window appears as

  10. Click Finish

    An Installing Software pop-up window will appear. During installation, it will show the various operations it is performing and a progress bar for each one. Because the installer is fetching various files online, this process might take a few minutes.

    The installation will pause, and a Selection Needed pop-up window appears.

  11. Check the box labeled Brainwy Software; Pydev; Brainwy.

    Check before proceeding that the Install pop-up window appears as

  12. Click OK

    The installation will finish (showing the final progress bars).

    A Software Updates pop-up window will appear.

  13. Click Yes

    Eclipse will terminate and restart. As you did in step 3, click OK to the Workspace Launcher pop-up window.

  14. Click Eclipse (to the right of Apple logo on the far left of the top tool bar), and then click Preferences in its pull-down menu, as shown below.
  15. Drill down to select the interpreter:
    • Disclose PyDev by clicking the triangle in front of PyDev or double-clicking PyDev (after the triangle).
    • Disclose Interpreters by clicking the triangle in front of Interpreters or double-clicking Interpreters (after the triangle).
    • Select Python - Interpreter.
    The Preferences pop-up window should appear as follows
  16. Click New.. at the top-right of the top window

    A Select Interpreter pop-up window appears.

    Type python34 in the Interpreter Name text box.
    Type (or cut/paste) //usr/local/bin/python3 in the Interpreter Executable text box (or browse to this file).
    The Select Interpreter pop-up window should appear as

  17. Click OK.

    A Selection needed pop-up window will appear.

    Ensure that a check appears in all four checkboxes.

  18. Click OK.

    The Preferences pop-up window will be changed to

  19. Click OK.

    A Progress Information pop-up window will appear.

    During installation, it will show the various operations it is performing and a progress bar for each one. Eventually the installation will terminate. Adobe lightroom 6.

  20. Click Window (to the left of Help on the far right of the top tool bar), hover over Open Perspective in the pull-down menu and then click Other.. in the next pull-down menu.

    The Open Perspective pop-up window will appear.

  21. Double-click PyDev (third from the bottom)

    The label on Eclipse will change from Java - Eclipse to PyDev - Eclipse, and the Package Explorer in the upper-left tab will change to PyDev Package Explorer, and a PyDev icon will appear to the right of the Java icon.

  22. Right-click the Java icon to the left of the PyDev icon and select close

    The Eclipse workbench will now have only the PyDev icon here and will look like

  23. Download the courselib.zip file.

    In the pop-window that appears

    ensure the Save File radio button is depressed and click OK.

  24. Locate the workspace folder created in step 3 (see /Users/yourname/Documents/workspace) and copy the courselib.zip file into this workspace and unzip it there, producing the courselib folder; it should should contain a bunch of Python module files (ending in .py). From time to time you will be asked to put other course-specific Python module files into this courselib folder; these modules will be usable in all Python projects in Eclipse.
  25. Inform Eclipse to use the courselib folder in all Python projects.
    • Select Eclipse | Preferences.
    • Disclose PyDev by clicking the triangle in front of PyDev or double-clicking PyDev (after the triangle).
    • Disclose Interpreters by clicking the triangle in front of Interpreters or double-clicking Interpreters (after the triangle).
    • Select Python - Interpreter.
    • Click the Libraries tab (leftmost, above the bottom pane)
    • Click the New Folder button (topmost, right of the bottom pane)
    • Browse to the courselib folder (added above) in the Browse for Folder pop-up window (/Users/yourname/documents/workspace/courselib).
    • Click the courselib folder selected, and then click OK
    • Click Apply (you will see some progress bars)
      The <><>< b=' /> pop-up window should now appear as

      notice a fifth entry (ending in courselib appears at the bottom of the bottom pane named system pythonpath

      < />< />
    • cick ok
  26. terminate (click x on) the eclipse window.
eclipse is now installed for python. b=' '="">