These instructions are for compiling Finch Scala programs on the command line. Scala plug-ins are also available for Netbeans, Eclipse, and IntelliJ.
2. Download the Finch Scala package and unzip it to a convenient directory.
3. Navigate to the Source directory.
LINUX USERS ONLY: You will need to install libusb-1.0 before compiling a program. To do so, run sudo apt-get install libusb-1.0-0-dev in any terminal window.
4. Compile a file by using the following incantation, where FILEPATH is the location of your file relative to the Source directory:
Windows: scalac -classpath .;finch.jar FILEPATH
Mac/Linux: scalac -classpath .:finch.jar FILEPATH
For example, if you wished to compile FinchScalaExample.scala, you would use:
Windows: scalac -classpath ;finch.jar FinchScalaExample.scala
Mac/Linux: scalac -classpath :finch.jar FinchScalaExample.scala
5. Run a file with the following incantation, where FILEPATH is the location of the compiled .class file you wish to run:
Windows: scala -classpath .;finch.jar FILEPATH
Mac: scala -classpath .:finch.jar:jnaerator-0.9.5.jar FILEPATH
Linux: sudo scala -Djava.library.path=. -cp .:finch.jar:jnaerator-0.9.5.jarFILEPATH. If you don't want to use sudo, follow these instructions to make it so regular users can access the Finch (credit: Meg Richards).
For example, if you wanted to run the previously compiled FinchScalaExample, you would use:
Windows: scala -classpath .;finch.jar FinchScalaExample
Mac: scala -classpath .:finch.jar:jnaerator-0.9.5.jar FinchScalaExample
Linux: sudo scala -Djava.library.path=. -cp .:finch.jar:jnaerator-0.9.5.jarFinchScalaExample
Note that you do not need to append ".class" to the end of your filename when using the scala command.
Mac/Linux users, note that you need to add both finch.jar and jnaerator-0.9.5.jar to the classpath.
Linux users, you can safely ignore the warnings before the "Connecting to Finch..." message.