PeterMmm
PeterMmm

Reputation: 24630

Running play! from Java

I'm trying to start a Play! instance from Java like this:

 public static void main(String[] args) {
        xsbt.boot.Boot.main(new String[]{"run"});
 }

that throws

Exception in thread "main" java.lang.IncompatibleClassChangeError: Expected static method scala.Array$.unapplySeq(Ljava/lang/Object;)Lscala/Option;
    at xsbt.boot.Boot$.main(Boot.scala:14)
    at xsbt.boot.Boot.main(Boot.scala)
    at PlayPlay.main(PlayPlay.java:16)

Is there a way to start Play! from a Java program ?

Upvotes: 1

Views: 142

Answers (1)

Nilanjan
Nilanjan

Reputation: 741

I am assuming you mean start the Play server. Then the following should work provided you have the classpath set properly.

public static void main(String[] args) throws Exception {
    play.core.server.NettyServer.main(args);
}

Upvotes: 1

Related Questions