问题
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:
- How to install minimal .Net and which version to get Scala to work.
- How to install the .Net variant of Scala and which version to use (preferred 2.9).
- How to get hello world to run.
Thanks in advance. Platform in question: Windows 7 professional 32 bit.
回答1:
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!")
}
回答2:
There are some instructions here:
http://lampwww.epfl.ch/~magarcia/ScalaNET/2011Q2/PreviewScalaNET.pdf
Along with a interview with Miguel Garcia who was (is?) working on it here
http://www.scala-lang.org/node/10299/
来源:https://stackoverflow.com/questions/11664072/step-by-step-guide-to-get-scala-to-run-on-net