coderodde
coderodde

Reputation: 977

No class Play in package play

I have the set up

<dependency>
    <groupId>com.typesafe.play</groupId>
    <artifactId>play_2.13</artifactId>
    <version>2.7.4</version>
</dependency>

in the project pom.xml. However, when I try to follow this tutorial, the statement play.Play.application() does not compile, giving me output

cannot find symbol
symbol:   class Play
location: package play

Could anyone, please, help me resolve this issue?

Upvotes: 0

Views: 44

Answers (1)

cbley
cbley

Reputation: 4608

Apparently the tutorial you're reading is using Play 2.0, which is rather old.

Lots of things have changed up to Play 2.7. Notably the removal of the global Play application in 2.6 (I think). In newer Play versions you need to inject the current application into your controller if you need that.

For your code at hand, you would probably need to inject the Redis component -- if that still exists for Play 2.7.

Better have a look at the new documentation here: https://www.playframework.com/documentation/2.7.x/Home

Upvotes: 1

Related Questions