Giter Site home page Giter Site logo

Comments (12)

mkurz avatar mkurz commented on May 30, 2024 1

When using Play 2.9.2 you do not have to add guice yourself. Just make sure you have libraryDependencies += guice then Guice 6.0 will be pulled in automatically from Play itself.

from playframework.

mkurz avatar mkurz commented on May 30, 2024

Play 2.8 does not support Java 17 out of the box, you need to upgrade guice yourself to make it work, see this guide:
https://github.com/playframework/playframework/releases/tag/2.8.15#user-content-java17

If you say you also tried with Play 2.9.2, did you run sbt clean before or remove the target folder before?
I am pretty sure Play 2.9.2 with Java 17 works well.

from playframework.

anitha1729 avatar anitha1729 commented on May 30, 2024

yeah, I did try deleting the target folder and did sbt clean before compile

from playframework.

mkurz avatar mkurz commented on May 30, 2024

Can you post your build.sbt and project/plugins.sbt? And/or run sbt dependencyTree so we find out which dependencies get pull in?

from playframework.

anitha1729 avatar anitha1729 commented on May 30, 2024

Can you please let me know what is the guice version while using paly 2.9.2?
Currently it is "com.google.inject" % "guice" % "4.2.3",

from playframework.

anitha1729 avatar anitha1729 commented on May 30, 2024

dependencyTree.txt
plugins.txt
build.txt

from playframework.

mkurz avatar mkurz commented on May 30, 2024

Let me know if it works, so we can close this issue, thanks!

from playframework.

anitha1729 avatar anitha1729 commented on May 30, 2024

It didn't work, I still see the same exception
image

from playframework.

mkurz avatar mkurz commented on May 30, 2024

So, in the logs you posted you still use Play 2.8.16.
If you want to use Ply 2.8 and Java 17 you have to add following dependencies listed here: https://github.com/playframework/playframework/releases/tag/2.8.15#user-content-java17

Just add

  // In your build.sbt add:
  libraryDependencies ++= Seq(
    "com.google.inject"            % "guice"                % "5.1.0",
    "com.google.inject.extensions" % "guice-assistedinject" % "5.1.0"
  )
 libraryDependencies += "net.jodah" % "typetools" % "0.6.3"

to your build.sbt

from playframework.

anitha1729 avatar anitha1729 commented on May 30, 2024

I have changed it to 2.9.2, addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.16") this remains same, right? or should I change the plugin

from playframework.

anitha1729 avatar anitha1729 commented on May 30, 2024

I have added this

 //libraryDependencies += guice
libraryDependencies ++= Seq(
  "com.google.inject"            % "guice"                % "5.1.0",
  "com.google.inject.extensions" % "guice-assistedinject" % "5.1.0"
)
libraryDependencies += "net.jodah" % "typetools" % "0.6.3"

Got the below error:

[error] (update) lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:
[error] https://repo1.maven.org/maven2/com/google/inject/guice/5.1.0/guice-5.1.0-no_aop.jar: not found: https://repo1.maven.org/maven2/com/google/inject/guice/5.1.0/guice-5.1.0-no_aop.jar

from playframework.

mkurz avatar mkurz commented on May 30, 2024

I took your config from above's comment and made it work with Play 2.9.2. I uploaded the result in to this repo https://github.com/mkurz/playframework-12630

You can see what I changed here: mkurz/playframework-12630@ea5dcc1

This is 100% not a bug in Play but you just messed up the config.

from playframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.