Get Java

Since Swift is written in Java, Java Runtime Environment 1.7 or greater is a required by Swift. We recommend Oracle Java, which can be downloaded from the Oracle website.

Get Swift

Download the latest packaged binaries from the swift downloads page. Untar the file, and export the path. Bash users could append their .bashrc file with the export statement to have swift in their path over multiple sessions.

The latest stable Swift release is Swift-0.96.2

tar xfz swift-0.96.2.tar.gz
export PATH=$PATH:/path/to/swift-0.96.2/bin

Run Swift

Example Swift scripts can be found in the swift-0.96.2/examples/misc directory. Scripts have a .swift file extension. Run the following commands to launch a simple hello world application.

swift hello.swift

When you run this application, it should create a file called hello.txt.

More documentation on how to run Swift can be found at