1

I developed a Scala project using Scala eclipse Ide. 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?

EECOLOR
  • 11,184
  • 3
  • 41
  • 75
yAsH
  • 3,367
  • 8
  • 36
  • 67

1 Answers1

3

You don't need to use SBT in order to create an executable jar file. A jar file is essentially only a zip file with a fixed internal structure. A jar file can contain a file "META-INF/MANIFEST.MF" with metdata like for instance the main class.

Refer to the Jar file article on Wikipedia for more information.

There is a command line tool called "jar" which can help you creating a valid Java Archive.

Björn Jacobs
  • 4,033
  • 4
  • 28
  • 47
  • I got the jar file containing some scala classes in it .Now, how do I call these from the command line? – yAsH May 21 '13 at 15:04
  • See this post for explanation: http://stackoverflow.com/questions/6780678/run-class-in-jar-file If you defined a main class in the manifest file, then you can simply run java -jar your-jar-file.jar – Björn Jacobs May 21 '13 at 15:52