c4k
c4k

Reputation: 4426

Stop exiting Eclipse with Play 2.3.X

If I run my application (Play 2.3.2) while Eclipse is running I always have strange compilation errors, no class def found errors, class not found errors, etc...

If I exit Eclipse and run my application, everything is working fine. But sometimes it's also working fine while Eclipse is running.

Am I the only one to experience that ? What is the cause ?

I suspect something in Eclipse changes my source files but I can't find what. Maybe Lombok ?

Thanks.

Upvotes: 0

Views: 230

Answers (2)

Alistair
Alistair

Reputation: 41

I have similar problems. Typesafe responded with a solution which I am currently trying out.

https://groups.google.com/forum/#!topic/play-framework/4RnbqEk-muM

Brief summary of the answer by @jroper :

Eclipse doesn't know how to keep its dirty hands off the same build directory that Play is using to compile your app - if you have both Play, and the IDE, trying to compile the same code at the same time, what do you think will happen? You will see random errors. You should configure Eclipse not to automatically build your app, or configure it to have different output directories.

Upvotes: 1

piknyc
piknyc

Reputation: 61

The Play Framework compiles everything to the directory target/scala-2.11/classes. When changing some of these classes, especially any views, causes Activator to auto compile the classes creating new class files. Hitting refresh on the project in Eclipse will update the project and class files in the classes directory causing a rebuild. This should make your compilation errors go away. If you still have issues, take a look at your .classpath file and the Eclipse build path settings.

Upvotes: 0

Related Questions