如何为 NetBeans 设置 Scala 插件来复制 Scala 运行时库?
版本: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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我总是手动复制 scala-library.jar (如果我运行项目的机器上没有安装 Scala),然后运行
如果您想要一个 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
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.)