在没有互联网连接的计算机上使用 Scala

2022-01-24 00:00:00 offline scala java sbt

我是 Scala 的新手,如果问题非常明显,我很抱歉.

I am new in Scala, so sorry if the question is absolutely obvious.

我的计算机上安装了 Eclipse Photon.想要编辑 Scala 代码并生成可运行的 jar.棘手的部分是我的计算机(Centos7)上没有互联网访问权限.

I have an Eclipse Photon installed on my computer. Would like to edit Scala code and produce runnable jars. The tricky part is that I don't have internet access on my computer (Centos7).

我牢记两个潜在的问题/问题:

I bear in mind two potential issues/questions:

  1. 手动下载插件:我知道,Eclipse 的 Scala IDE 插件可以运行 Scala 代码/生成 jar(如 https://medium.com/devilsadvocatediwakar/how-to-install-scala-plugins-in-eclipse-in-ubuntu-13e53ffe3f39).从 GUI 安装它相当简单.是否可以手动(而不是从 GUI)下载插件包,将其移动到目标计算机并最终安装?
  2. 将代码编译到 jars 中:假设第 1 点已经完成.SBT 或 Maven 需要一些依赖项(例如 Yoda 时间、Spark 库)来生成特定的 jar - 它是否会导致所有依赖项也必须手动移动和安装?
  1. Downloading the plugin manually: I know, that Scala IDE plugin for Eclipse enables running Scala code/producing jars (like https://medium.com/devilsadvocatediwakar/how-to-install-scala-plugins-in-eclipse-in-ubuntu-13e53ffe3f39). Installing it from the GUI is rather straight forward. Is it possible to download a plugin bundle manually (not from GUI), move it to target computer and finally install it?
  2. Compiling code into jars: assume that the point 1 is done. SBT or Maven requires some dependencies (e.g. Yoda time, Spark libraries) to produce specific jars - does it cause, that all the dependencies shall be moved and installed manually also?

推荐答案

答案由 Luis Miguel Mejía Suárez 在评论中提供:

The answer was provided by the Luis Miguel Mejía Suárez in comments:

是的,你可以.用于安装手动插件 - 在这里你可以找到ScalaIDE 的 zip - 最后,使用 maven 存储库 进行搜索并下载依赖项 JARS ......但是,这真的是你的吗?个人电脑?或某种部署服务器?- 另外,作为ScalaIDE 的前用户我建议您尝试不同的,较新的 IDE.例如,我上周刚从 Eclipse 切换到带有金属的 VSCode.

Yes you can. For installing a manual plugin - here you can find the zip of the ScalaIDE - and finally, use the maven repository to search and download the dependencies JARS... However, is this really your personal computer? or some kind of deployment server? - Also, as an ex-user of the ScalaIDE I would recommend you to try a different, newer IDE. For example, I just switched the last week from Eclipse to VSCode with metals.

相关文章