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

wget http://swiftlang.org/packages/swift-0.96.tar.gz.
tar xfz swift-0.96.tar.gz
export PATH=$PATH:/path/to/swift-0.96/bin

Run Swift

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

cd swift-0.96/examples/
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 http://www.ci.uchicago.edu/swift/docs/index.php.