Appendix. Installation and development setup
In order to run the code in this book, you need to set up your development machine with several components that will help you generate, build, and run Scalatra applications. This appendix will give you a quick start.
Scalatra runs on the Java Virtual Machine (JVM), so you need a Java Development Kit (JDK). Many systems come with a JDK preinstalled; let’s check first to see whether you’ve got one. Run this in a DOS or Unix console:
This should give back the following:
Also run this:
You should see something like this:
If both commands spew forth responses like those shown here, you’re all set. The key thing is the number 1.7 in the responses. If you see 1.6, your version of Java is too old, and you’ll need to upgrade.
Scalatra 2.4.0 requires Java 7 (a JVM version of 1.7). As of this writing, the Scala 2.11.x language has experimental support for Java 8 (JVM 1.8.x). This means Java 8 may work for you, but you probably shouldn’t depend on it in a production situation until Scala 2.12 is available. If you don’t already have a JDK, or if your version is too old, go here and follow the install instructions: http://docs.oracle.com/javase/7/docs/webnotes/install/index.html.