Lu Ming Lu Ming - 1 month ago 12
Java Question

How to create Play! Framework JAVA application with JetBrains IntelliJ Idea 13? I only find the Scala project

How to create Play! Framework 2.3 JAVA application with JetBrains IntelliJ Idea 13?

I only find the Play! Framework Scala application in IntelliJ Idea.

Answer

I don't believe it is possible to create a Java Play! project from directly within IDEA. You have two options:

  1. Create a scala project using IDEA and manually create new Java classes. You can then modify your routes file to call on these Java classes.

  2. Create the project from the command line, then open it in IDEA. This can be done like so:

    activator new [projname] play-java
    cd [projname]
    activator idea
    

You should then be able to import the project into IDEA but I'm not sure how well it will work. The documentation for the "activator idea" command seems to have disappeared in the more recent versions of Play! though, so I don't know how long that feature will last.

References:

https://www.playframework.com/documentation/2.3.x/NewApplication https://www.playframework.com/documentation/2.3.x/IDE

Comments