scalascala-2.9

Step by step guide to get Scala to run on .net?


I have never used .Net framework and need to demonstrate to someone that Scala indeed works on .Net. I need to get a "quick and dirty" .Net setup with Scala working on some existing JVM Scala code. I could not find a step-by-step guide for this. I would appreciate some resources on this:

  1. How to install minimal .Net and which version to get Scala to work.
  2. How to install the .Net variant of Scala and which version to use (preferred 2.9).
  3. How to get hello world to run.

Thanks in advance. Platform in question: Windows 7 professional 32 bit.


Solution

  • Self-explaining file

    helloworld.scala

    /*
    see https://github.com/magarciaEPFL/scaladotnet#readme
    quick test
    ==========
    1. Name this file helloworld.scala and put it in c:\scala-dotnettest
    2. Download binaries from https://github.com/magarciaEPFL/scaladotnet/downloads and unpack the zipped files to the directory c:\scala-dotnet
    3. Compile with: c:\scala-dotnet\scalacompiler -d c:\scala-dotnettest -target:exe -Xassem-extdirs c:\scala-dotnet -Xassem-name helloworld.exe -Xshow-class HelloWorld helloworld.scala
    4. Copy runtime dependencies scalalib.dll, IKVM.OpenJDK.Core.dll, IKVM.OpenJDK.Util.dll and IKVM.Runtime.dll (or all IKVM*.dll) from c:\scala-dotnet to c:\scala-dotnettest
    5. run helloworld
    C:\scala-dotnettest>helloworld
    Hello World!
    */ 
    object HelloWorld extends App {
      println("Hello World!")
    }