How to run a Play project in Eclipse

hello I tried to find how to start a Java Play project in eclipse, but I can not find an easy way. Here is what i did

Create project

play new testApp 

Go to the folder

 cd testApp 

Project eclipse

 play eclipsify 

Open eclipse and import as an existing project , but then I don’t know how to start the server from eclipse

Note: I know that I can run it in the console as well. The problem is that I added the Eclispe project to the build path using Eclipse, so if I run it in the console, I think this will not work, or am I mistaken?

+6
source share
5 answers

Play eclipsify creates a launch configuration for you.

Run -> Run Configurations -> Java Applications -> testApp

If you need to debug the application first, as indicated, then

Run -> Debug Configurations -> Remote Java Applications -> Connect JPDA to testApp

+3
source

In new versions of the game, the team has changed to

 play eclipse 
+16
source

To play 2.xy, the activator is the tool of choice

 activator eclipse 

or

 ./activator eclipse 

use a copy of the local project activator (if exists)

+7
source

The following procedure can be used to compile and import the sbt play project into an eclipse IDE:

  1. Go to your project folder, create a text file plugins.sbt and add the following code:

     addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.2") 
  2. To force compilation, add the following code to your build.sbt project build.sbt :

     EclipseKeys.preTasks := Seq(compile in Compile, compile in Test) 
  3. Make sure the Scala IDE is installed in eclipse (download from: scala-ide.org )

  4. At the command prompt, enter sbt to compile the sbt play project.

  5. After successfully compiling in sbt, use the eclipse command to create the Eclipse> eclipse project files. Check for [info] successfully created Eclipse project files for projects:

  6. Go to the eclipse IDE and use the Import Wizard to import existing projects into the workspace.

+1
source

I tried to "play eclipsify", but that did not work as it changed to "play eclipse" and it works fine.

0
source

Source: https://habr.com/ru/post/916840/


All Articles