简体   繁体   English

在不使用Sbt或Maven的情况下从Scala项目创建jar文件

[英]Creating a jar file from Scala project without using Sbt or Maven

I developed a Scala project using Scala eclipse Ide. 我使用Scala eclipse Ide开发了一个Scala项目。 How do I get a jar file from this project so that i can run the Scala classes present in the project through command line? 如何从该项目获取jar文件,以便我可以通过命令行运行项目中存在的Scala类?

You don't need to use SBT in order to create an executable jar file. 您不需要使用SBT来创建可执行jar文件。 A jar file is essentially only a zip file with a fixed internal structure. jar文件基本上只是一个具有固定内部结构的zip文件。 A jar file can contain a file "META-INF/MANIFEST.MF" with metdata like for instance the main class. jar文件可以包含带有metdata的文件“META-INF / MANIFEST.MF”,例如主类。

Refer to the Jar file article on Wikipedia for more information. 有关更多信息,请参阅Wikipedia上Jar文件文章

There is a command line tool called "jar" which can help you creating a valid Java Archive. 有一个名为“jar”的命令行工具可以帮助您创建有效的Java Archive。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM