Spoofax is distributed as an Eclipse plugin. This guide shows how to download, install, and run Spoofax in Eclipse.
Spoofax runs on the major operating systems:
Spoofax requires a working internet connection to download several libraries when it is first started. These libraries are cached afterwards, and only need to be re-downloaded when you update Spoofax.
Installing the Spoofax Eclipse Plugin
|macOS| macOS)Using Homebrew (
Install the latest release of Spoofax Eclipse as follows:
brew tap metaborg/metaborg brew cask install spoofax
The optional command-line tools are installed with:
brew install strategoxt
Continue at Running Eclipse.
Upgrading the Spoofax cask using
brew cask upgrade --greedy will lose all manually installed plugins. It is recommended to use Eclipse update sites to keep Spoofax up-to-date.
Download (all platforms)
To get started with Spoofax, download an Eclipse Oxygen installation with Spoofax preinstalled for your platform:
These are bundled with an embedded Java Runtime Environment (JRE) version 8, such that a JRE on your system is not required. If your system has a JRE of version 8 or higher installed, and would rather use that, use the following download links instead:
Unpack the downloaded archive to a location with write access, since Eclipse requires write access to the unpacked Eclipse installation.
On |macOS| macOS Sierra (10.12) and above, you must move the unpacked :file:`spoofax.app` file to a different location (such as :file:`Applications`) after unpacking, to prevent App Translocation from moving the app into a read-only filesystem, breaking Eclipse and Spoofax.
Alternatively, you can prevent App Translocation by clearing attributes from the application. To do this, open the Terminal, navigate to the directory where the :file:`spoofax.app` is located, and execute:
xattr -rc spoofax.app
Start up Eclipse, depending on your operating system:
- |Windows| Windows: open :command:`spoofax/eclipse.exe`
- |Linux| Linux: open :command:`spoofax/eclipse`
- |macOS| macOS: open :command:`spoofax.app`
If Eclipse cannot be opened because it is damaged, open the Terminal, navigate to the directory where :file:`spoofax.app` is located, and execute:
xattr -rc spoofax.app
This will clear the attributes that Eclipse has been downloaded from the internet, and grant permission to open Eclipse.
before the line:
After starting up, choose where your workspace will be stored. The Eclipse workspace will contain all of your settings, and is the default location for new projects.
Some Eclipse settings unfortunately have sub-optimal defaults. After you have chosen a workspace and Eclipse has completely started up, go to the Eclipse preferences and set these options:
- :menuselection:`General --> Startup and Shutdown`
- :menuselection:`General --> Workspace`
- :menuselection:`Maven --> Annotation Processing`
Changing Eclipse Memory Allocation
By default a plain Eclipse has a maximum heap size of 1 GB. You may want to increase this limit. The default for the Eclipse application produced by Spoofax is 2 GB.
To run Eclipse once with a different memory limit, call it from the command-line like this:
eclipse [normal arguments] -vmargs -Xmx2G
If this works, you can permanently apply this limit in the
in the Eclipse installation directory (|macOS| macOS:
the Eclipse package) by changing the
-Xmx argument. For example:
-vmargs [...] -XstartOnFirstThread -Xss16M -Xms2G -Xmx2G -Dosgi.requiredJavaVersion=1.8 -server
- the size of the thread stack
- the initial size of the heap
- the maximum size of the heap
Follow the :ref:`Getting Started guide <langdev-getting-started>` to get started with Spoofax in Eclipse.