如何为 NetBeans 设置 Scala 插件来复制 Scala 运行时库?

发布于 2024-08-27 14:32:25 字数 849 浏览 5 评论 0原文

版本:NetBeans 6.8、Scala Kit 0.16.1

当我编译项目时,我得到以下输出:

init:
deps-jar:
Compiling 2 source files to F:\MyProgramming\NorvigSpellChecker\build\classes
compile:
Created dir: F:\MyProgramming\NorvigSpellChecker\dist
Building jar: F:\MyProgramming\NorvigSpellChecker\dist\NorvigSpellChecker.jar
Not copying the libraries.
To run this application from the command line without Ant, try:
java -jar "F:\MyProgramming\NorvigSpellChecker\dist\NorvigSpellChecker.jar"

jar:
BUILD SUCCESSFUL (total time: 3 seconds)

当然,库 应该复制,所以我实际上无法使用此命令行运行它。我在项目配置中没有看到任何复制库的选项。

该插件使用 Ant 进行构建,但我没有任何经验;想必告诉 Ant 复制库应该很容易。这里是build-impl.xml,我应该在build.xml中做什么?

Versions: NetBeans 6.8, Scala Kit 0.16.1

When I compile my project, I get the following output:

init:
deps-jar:
Compiling 2 source files to F:\MyProgramming\NorvigSpellChecker\build\classes
compile:
Created dir: F:\MyProgramming\NorvigSpellChecker\dist
Building jar: F:\MyProgramming\NorvigSpellChecker\dist\NorvigSpellChecker.jar
Not copying the libraries.
To run this application from the command line without Ant, try:
java -jar "F:\MyProgramming\NorvigSpellChecker\dist\NorvigSpellChecker.jar"

jar:
BUILD SUCCESSFUL (total time: 3 seconds)

Of course, the libraries should be copied, so I can't actually run it by using this command line. I don't see any options to copy the library in the project configuration.

The plugin uses Ant for building, but I don't have any experience with it; presumably it should be easy enough to tell Ant to copy the libraries. Here is build-impl.xml, what should I do in build.xml?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叫思念不要吵 2024-09-03 14:32:25

我总是手动复制 scala-library.jar (如果我运行项目的机器上没有安装 Scala),然后运行

java -cp path/to/scala-library.jar:other/path/to/NBProject.jar NBProject

​​如果您想要一个 jar 来运行,这并不完全是您问题的答案部署并运行,但这可能是暂时有用的解决方法。

(顺便说一下,Windows 使用 ; 而不是 : 作为类路径分隔符。另外,如果您使用 Swing,您还需要将 scala-swing.jar 复制到某处你可以在类路径中找到它。)

I always copy scala-library.jar by hand (if Scala is not installed on the machine I'm running the project on), and run with

java -cp path/to/scala-library.jar:other/path/to/NBProject.jar NBProject

This isn't exactly an answer to your question if you're after a single jar to deploy and run, but it might be a useful workaround temporarily.

(By the way, think Windows uses ; instead of : for the classpath separator. Also, if you use Swing, you'll also need scala-swing.jar copied somewhere you can find it, and in the classpath.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文