Wilson Mar bio photo

Wilson Mar

Hello. Hire me!

Email me Calendar Skype call 310 320-7878

LinkedIn Twitter Gitter Google+ Youtube

Github Stackoverflow Pinterest

Open source and free since the 90’s.


Overview

This article contains note on my personal experience installing and using Eclipse IDE.

Eclipse was originally funded by IBM as open source.

The editions of Eclipse IDE:

  • The “Standard” edition for working with Java is free
  • The edition working with Web (HTML) is licensed (costs money)
  • STS edition

Standard Edition Homebrew install

The simplest way to install the standard edition of Eclipse is to use Homebrew to eclipse-java:

  1. First, update the Homebrew installation bits shared:

    brew update
    

    This can take a while.

  2. Use cask to install GUI programs:

    brew cask install eclipse-java
    

    The response (as of 24 July 2017):

    ==> Satisfying dependencies
    ==> Downloading https://www.eclipse.org/downloads/download.php?file=/technology/
    ######################################################################## 100.0%
    ==> Verifying checksum for Cask eclipse-java
    ==> Installing Cask eclipse-java
    ==> Moving App 'Eclipse.app' to '/Applications/Eclipse Java.app'.
    🍺  eclipse-java was successfully installed!
    

    Remember the name of the app is “Eclipse Java”.

    Invoke

  3. On a Mac, in a Finder click Go > Applications or click the “rocket ship” icon if you have that at the bar at bottom of the screen.

  4. Type the portion of “Eclipse Java” until the icon appears.

    Add STS

    In a Standard Eclipse, you can add STS in

  5. Help > Eclipse Marketplace and Find: Spring.
  6. Click Install.
  7. In Confirm Selected Features, check all (for AOP, AERI, Roo, etc.) explained later.

    Uninstall Homebrew

  8. The nice thing about using Homebrew is uninstallation is easy:

    brew cask uninstall eclipse-java
    

Alternately:

STS install on Macs

There is no Homebrew module for the Spring Tools Suite (STS) for Mac.

  1. Use a modern internet browser to the STS download page at
    https://spring.io/tools/sts/all
  2. Click on “Based on Eclipse 4.7.0”, then “tar.gz”.

    spring-tool-suite-3.9.0.RELEASE-e4.7.0-macosx-cocoa-x86_64.tar is 412.5 MB.

  3. In Finder, select the Download folder to receive the file, then click “Save”.
  4. While you’re waiting, switch to exit the download web page.
  5. Double click on the file to unzip it to a new folder.

    CAUTION: If you see a number to the right of the “sts-bundle” folder name, another installer was downloaded previously.

  6. In Finder, navigate inside the “sts-bundle” folder.
  7. Open a new Finder new window and click the Go menu for the /Applications folder.
  8. If there is another STS app there, move it to Trash.

  9. Long-Click on the STS app file, then drag and drop it onto the Applications window.
  10. Open STS by double-clicking the icon. It may take a minute to load the first time.
  11. Press command+tab until your land on the green Spring app icon for the Eclipse Launcher.
  12. Check “Use this as the default and do not ask again”.
  13. PROTIP: The default directory generated should be changed per your organization’s standards.

    /Users/mac/Documents/workspace-sts-3.9.0.RELEASE

    PROTIP: This folder path is where you should do git clone. The one I use is
    /Users/mac/gits/spring. Others define a “dev” folder
    /Users/mac/dev/workspace

    This can be changed to something else later (in Files, Switch Workspace).

    The folder path is created when you click “Launch”.

  14. For the menu, click on the white space in the Dashboard with Package Explorer.

    See https://www.predix.io/resources/tutorials/journey.html#1607

Included with STS (Spring Tools Suite) is the developer edition of Pivotal tc Server, the drop-in replacement for Apache Tomcat that’s optimized for Spring.

The Spring Insight console, tc Server Developer Edition, provides a graphical real-time view of application performance metrics that lets developers identify and diagnose problems from their desktops.

First Time Preferences

When you invoke Eclipse for the first time, you see a “Welcome” screen.

  1. At the lower-right of the screen, uncheck “Always show Welcome at start up”.

  2. Click “Review IDE configuration settings” to “Review the IDE’s most fiercely contested preferences”.

    • Show line numbers in editor: yes.
    • Check spelling
    • Execute jobs in background
    • Encode text files with UTF-8
    • Enable preference recorder

  3. Check “Always exit without prompt” (your call).

  4. Click “Open an existing file”.

    Compile from Eclipse

  5. Click Finish.

  6. To compile and run your program, keep the “Main” app Java file tab active and

    • use Run option available in the Eclipse IDE or
    • press Ctrl + F11 to compile and run your MainApp application.

    If everything is fine with your application, this will print the following message in Eclipse IDE’s console.


New Project

  1. Right-click on the blank part under “Project Explorer” to select “New” and “Other”.

  2. In the New Select a Wizard dialog, select “Java Project”, then “Next”.

  3. Type your Project Name.

  4. It’s best to leave the default JRE version because additional downloads are necessary if you want to change it.

  5. Click Finish.

  6. Check “Remember” then click “Yes” to associate the project with a perspective.

    Notice several JRE System Libraries were added automatically. .jar files are Java classes. .dll files are Windows classes.

    Notice the “src” folder is created to hold source code.

  7. Right-click the app name to select Package (test suite).

  8. Name it “Basics”.

  9. Right-click on “Basics”.

  10. Type the Name for Java Class, such as “helloworld”.

Perspectives

Perspectives define the size and location of different views on the workspace window.

  1. Right-click on the Perspectives icon at the upper-right corner and select “Show Text”.

  2. Click the icon to the right of the Perspective icon to open a list of perspectives.
  3. Click Cancel

Views

Plug-ins

  • Checkstyle

  • EclEmma - Java Code Coverage for Eclipse

  • Spelling checking

  • Formatter

Video Tutorials

There are a lot on YouTube:

Pluralsight.com has a two-part series on Eclipse from 2013 by Tod Gentille (@Tod Gentille) of syncorsystems.com:

Shortcuts

To go back to previous edit location: Control+Q

https://www.youtube.com/watch?v=ZUM9jEhLie0

https://www.youtube.com/watch?v=E3hKgb4aLHM

https://www.youtube.com/watch?v=X8Xw7FWw49E