让 Scala 在 .net 上运行的分步指南? [英] Step by step guide to get Scala to run on .net?

查看:42
本文介绍了让 Scala 在 .net 上运行的分步指南?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从未使用过 .Net 框架,需要向某人证明 Scala 确实适用于 .Net.我需要在一些现有的 JVM Scala 代码上使用 Scala 进行快速而肮脏"的 .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. 如何安装最小的 .Net 以及让 Scala 工作的版本.
  2. 如何安装 Scala 的 .Net 变体以及要使用的版本(首选 2.9).
  3. 如何让 hello world 运行.

提前致谢.相关平台:Windows 7 专业版 32 位.

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

推荐答案

自解释文件

/*
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!")
}

这篇关于让 Scala 在 .net 上运行的分步指南?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆