Installation¶
This guide will help you install and set up the Onion programming language on your system.
Prerequisites¶
Onion runs on the JVM and requires:
- Java Development Kit (JDK) 17 or later
- SBT (Scala Build Tool) - for building from source
Installation Methods¶
Method 1: Download Pre-built Binary (Recommended)¶
- Download the latest release from the GitHub Releases page
- Extract the archive:
- Add the
bindirectory to your PATH:
Method 2: Build from Source¶
-
Clone the repository:
-
Build the project with SBT:
-
Create the distribution package:
This creates a distribution ZIP in target/onion-dist.zip
- Or build a standalone JAR:
This creates onion.jar under the active Scala target directory (currently target/scala-3.3.7/)
- Run the local installer if you want shell commands in
~/.local/bin:
Verify Installation¶
Check that Onion is installed correctly:
# If using the distribution
onionc --help
onion repl
onion-repl
# If using the JAR directly
java -jar onion.jar --help
IDE Setup¶
Visual Studio Code¶
While there's no official Onion extension yet, you can use:
- Generic syntax highlighting for similar languages
- Java/Scala extensions for dependency management
IntelliJ IDEA¶
For developing the Onion compiler itself:
- Install the Scala plugin
- Import the project as an SBT project
- The IDE will automatically download dependencies
Next Steps¶
- Hello World Tutorial - Write your first Onion program
- Quick Start Guide - Learn the essential features