众所周知,学习scala的第一大问题是难安装,第二大问题是java虚拟机启动慢。如果每次修改点脚本都要花10秒钟编译。。。
所以如果只是写写简单程序的话,你可以用一个scala kernel武装你的 jupyter笔记本搞定它。比如almond。
如果你和我一样用win,下面的安装脚本可能无法直接运行。
git clone https://github.com/almond-sh/almond.git
set SCALA_VERSION=2.12.8
set ALMOND_VERSION=0.5.0
bitsadmin /transfer downloadCoursierCli https://git.io/coursier-cli "%cd%\coursier"
bitsadmin /transfer downloadCoursierBat https://git.io/coursier-bat "%cd%\coursier.bat"
.\coursier bootstrap -i user -I user:sh.almond:scala-kernel-api_2.12.8:0.5.0 --no-default -r central -r jitpack sh.almo
nd:scala-kernel_2.12.8:0.5.0 -o almond
.\almond --install
这里有两个zhuangbi的bitsadmin语句,其实就是从相应网址下载文件而已。可以自己手动下载。
在win命令行中是不能直接dot-slash的。这个无扩展名的coursier可以用java运行:
java -jar coursier bootstrap -i user -I user:sh.almond:scala-kernel-api_2.12.8:0.5.0 --no-default -r central -r jitpack sh.almond:scala-kernel_2.12.8:0.5.0 -o almond
注意你的系统环境应该有java的path。否则即使装好了最后kernel也跑不起来。
运行完毕后应该会给你写出一个almond.bat。如果它不行就直接
java -jar almond --install
总之,win下装这些东西就是很费劲。(当然我在一台破linux机器上也失败了 ,原因是unknown architecture i386囧)
所以如果只是写写简单程序的话,你可以用一个scala kernel武装你的 jupyter笔记本搞定它。比如almond。
如果你和我一样用win,下面的安装脚本可能无法直接运行。
git clone https://github.com/almond-sh/almond.git
set SCALA_VERSION=2.12.8
set ALMOND_VERSION=0.5.0
bitsadmin /transfer downloadCoursierCli https://git.io/coursier-cli "%cd%\coursier"
bitsadmin /transfer downloadCoursierBat https://git.io/coursier-bat "%cd%\coursier.bat"
.\coursier bootstrap -i user -I user:sh.almond:scala-kernel-api_2.12.8:0.5.0 --no-default -r central -r jitpack sh.almo
nd:scala-kernel_2.12.8:0.5.0 -o almond
.\almond --install
这里有两个zhuangbi的bitsadmin语句,其实就是从相应网址下载文件而已。可以自己手动下载。
在win命令行中是不能直接dot-slash的。这个无扩展名的coursier可以用java运行:
java -jar coursier bootstrap -i user -I user:sh.almond:scala-kernel-api_2.12.8:0.5.0 --no-default -r central -r jitpack sh.almond:scala-kernel_2.12.8:0.5.0 -o almond
注意你的系统环境应该有java的path。否则即使装好了最后kernel也跑不起来。
运行完毕后应该会给你写出一个almond.bat。如果它不行就直接
java -jar almond --install
总之,win下装这些东西就是很费劲。(当然我在一台破linux机器上也失败了 ,原因是unknown architecture i386囧)