I am trying to export a SimpleSwingApplication as an executable JAR with Eclipse:
package gui
import scala.swing._
object Startup extends SimpleSwingApplication {
// ...
}
However, when I choose Export…/Java/JAR file and come to the part where I have to pick the Main class, Eclipse doesn’t seem to be able to find one. Manually typing in gui.Startup doesn’t help.
I thought maybe that’s because Startup is an object instead of a class, or maybe it has to do with inheriting the main method instead of providing one yourself. But even this simple code fails to export:
package gui
class Main {
def main(args: Array[String]) {
println("hello")
}
}
What am I missing?
Try creating your own manifest file, and specify the main class yourself. When you export the jar file, eclipse will have a screen where you can select your own manifest file instead of generating one.
This example manifest should do the trick: