Introduce Eclipse with brew cask on Macintosh OS X (5 walls + 1)

I ran into a number of barriers trying to bring Eclipse to Macintosh OS X 10.12.6. A record of overcoming five walls.

Wall 1 How to put brew

How to put brew. brew runs on ruby. Mac OSX 10.x comes with ruby as standard, so it's easy. However, there are cases where binaries cannot be introduced even with brew. In that case, compile. Then, if Xcode is not installed, it is necessary to install Xcode. Even if Xcode is included, it may not work without command line tools.

Also, if you have multiple versions of ruby, multiple versions of JAVA, or multiple versions of the C compiler before using brew, you don't know where the problem will occur.

If you just bought it or replaced the OS, you should install brew first.

How to install brew

[How to install brew] https://qiita.com/megu_ma/items/820695ac525030285682

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Depending on the environment, it may be necessary to add the sudo command. $ Is an example of a prompt symbol. You don't have to enter $.

The problem with the brew wall is that you can't proceed without a C / C ++ compiler called Xcode. Encounter a situation where the C compiler does not fit properly.

Wall 2 How to put the C compiler

When installing software with brew, it may try to compile on the assumption that Xcode is included. I think that the introduction of Xcode is indispensable.

The trouble with Xcode is that when the OS version changes, the Xcode version also changes, so I'm wondering whether to install the latest Xcode after removing the old one or update it. Sometimes.

Search if you are unsure about how to install Xcode.

Xcode search on the Apple Store. Search on Apple's Web. https://itunes.apple.com/us/app/xcode/id497799835?mt=12&ign-mpt=uo=2 「view in Apple Store」

Once Xcode is available, command line tools will be introduced. I often come across a message saying code-select --install in brew.

$ xcode-select --install

Wall 3 How to put JAVA

I put Java and Eclipse, but the Java version is old or not supported. Even if you install Java after installing Eclipse, the Java version is also old or not supported. If you download the software, unzip it, and install it, the consistency with the installed version will not be checked automatically. In that respect, Home-brew (command name is brew) confirms the consistency of the software to be installed and installs it. However, not everything is perfect. If it's not a standard method like brew cask, the procedure may affect you. Therefore, I will record how to install Eclipse and JAVA on Macintosh without any contradiction. If you don't have the proper JAVA yet, it's still a good idea to do it with brew cask install.

$ brew cask install java
==>Caveats
This Cask makes minor modifications to the JRE to prevent issues with
packaged applications, as discussed here:

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361

If your Java application still asks for JRE installation, you might need
to reboot or logout/login.

Installing this Cask means you have AGREED to the Oracle Binary Code
License Agreement for Java SE at
  https://www.oracle.com/technetwork/java/javase/terms/license/index.html

==>Satisfying dependencies
==>Downloading http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_osx-
 ######################################################################## 100.0%
==>Verifying checksum for Cask java
==>Installing Cask java
==>Running installer for java; your password may be necessary.
==>Package installers may write to any location; options such as --appdir are igno
Password:
==>installer: Package name is JDK 9.0.1
==>installer: Upgrading at base path /
==>installer: The upgrade was successful.
  java was successfully installed!

Wall 4 How to insert Eclipse

If various tools based on Eclipse are included, various problems will be encountered when introducing Eclipse. As a result, it was the fastest way to introduce it with brew cask. (Enter the line starting with $. Output otherwise.)

There was no eclipse in brew cask, such as eclipse-installer.

$ brew cask install eclipse
Error: Cask 'eclipse' is unavailable: No Cask with this name exists. Did you mean one of these?
eclipse-cpp                 eclipse-jee                 eclipse-ptp
eclipse-ide                 eclipse-modeling            eclipse-rcp
eclipse-installer           eclipse-php                 eclipse-smarthome-designer
eclipse-java                eclipse-platform            nodeclipse

I'm trying to introduce papyrus that describes UML, so I will use eclipse-modeling. eclipse-modeling introduces basic tools related to eclipse and modeling, and papyrus etc. can be introduced in the menu.

$ brew cask install eclipse-modeling
==>Satisfying dependencies
==>Downloading https://www.eclipse.org/downloads/download.php?file=/technology/epp
 ######################################################################## 100.0%
==>Verifying checksum for Cask eclipse-modeling
==>Installing Cask eclipse-modeling

==>Moving App 'Eclipse.app' to '/Applications/Eclipse Modeling.app'.
  eclipse-modeling was successfully installed!

If you want to include a JAVA integrated environment

$ brew cask install eclipse-java

If you want to put in a C ++ integrated environment

$ brew cask install eclipse-cpp

Wall 5 Organize in disk, how to cut Path

If you install software by a method other than brew, there are various system setting methods with that software, path setting, .bash_profile editing, etc., it gets even more messy. No matter what I touch, I get an error. You can't just edit .bash_profile. Set .bash_profile on your system with the source command.

$ echo 'export PATH=$HOME/workdir' > ~/.bash_profile
$ source ~/.bash_profile

Reference (self) I encountered various errors in various procedures other than the above. I'm organizing what I recorded here and there.

Click here for an example

[Link] https://researchmap.jp/jo98imc4p-2078500/#_2078500

XYZ in programming language education https://qiita.com/kaizen_nagoya/items/1950c5810fb5c0b07be4

p.s.20180213 Addendum ver2 Change the order of the walls and add the following.

Wall +1

In the training Macintosh of Nagoya Municipal Industrial Research Institute, brew is managed by the ID brew_manaegr. Therefore, if you want to put in a java integrated environment,

$ su brew_manager
$ password:xxxxxx
$ brew cask install eclipse-java

Must be.

Detail is "Advantages and disadvantages of setting an administrator for brew with a different ID" https://qiita.com/kaizen_nagoya/items/4967f6b8cf02952f5f40

References / URL

What to do for the time being after installing eclipse https://qiita.com/yusukaaay/items/4ddc003d172497acba8b

Eclipse settings (Mac version) https://qiita.com/Tsuji_Taku50/items/aeca1b7a69942a704509

How to change the memory allocated to Eclipse (Mac version) https://qiita.com/Tsuji_Taku50/items/c48b6ec033f83c1e15ac

Install eclipse on Mac https://qiita.com/yusukaaay/items/fa87cd94e6788cabafca

Java + Eclipse development environment construction MacOSX edition https://qiita.com/hiesiea/items/4d4e32dba56be7143496

We recommend the brew cask method rather than the two articles above.

Document history

ver 1.00 First draft 2017/12/15 ver 1.01 Change the order of the walls Reference postscript 2018/02/13 ver 1.02 shell-session added, references / URL added 2018/03/27

Recommended Posts

Introduce Eclipse with brew cask on Macintosh OS X (5 walls + 1)
Notes on installing eclipse with Homebrew on Mac OS High Sierra