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

空扰寡人 提交于 2019-12-21 05:04:01

问题


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.


回答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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!