1
votes

note: I recently jumped into Play Framework, so I am still learning all about it

I am trying to create a simple Webapp using the Play Framework.\

(edit) Software Versions:

  • Arch Linux: 4.11.7-1-ARCH x64
  • Oracle Java JDK: 1.8.0_131
  • IntelliJ Scala plugin: 2017.1.19 (latest)
  • SBT: 0.13.13 (latest)
  • IntelliJ IDEA Ultimate 2017.1.4
  • Play Framework: 2.6.1

What I did:

I followed this tutorial from the Jetbrains site to start a Play Framework project. I followed the instructions exactly.

  1. I installed the Scala plugin
  2. Created new project > Scala > Play 2.x (shown in the image is Scala, Dotty, SBT, Activator, Play 2.x. My options were SBT, IDEA, Activator, Play 2.x)
  3. Project details page looked similar, using Scala 2.11 and Play 2.6.1 and Java JDK 1.8.0_131

Problem:

  1. Clicked finish and I expected to see the next image with the project directory structure shown. All that was shown is 3 Entries: .gitignore file, build file and External Libraries

Since something had gone wrong, I decided to import the project, when doing so, by selecting SBT project model I get an import error:

Importing error:

Error:Error while importing SBT project:<br/>...<br/><pre>at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:66)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:49)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:33)
at sbt.MainLoop$.runLogged(MainLoop.scala:25)
at sbt.StandardMain$.runManaged(Main.scala:57)
at sbt.xMain.run(Main.scala:29)
at xsbt.boot.Launch$$anonfun$run$1.apply(Launch.scala:109)
a
t xsbt.boot.Launch$.withContextLoader(Launch.scala:128)
at xsbt.boot.Launch$.run(Launch.scala:109)
at xsbt.boot.Launch$$anonfun$apply$1.apply(Launch.scala:35)
at xsbt.boot.Launch$.launch(Launch.scala:117)
at xsbt.boot.Launch$.apply(Launch.scala:18)
at xsbt.boot.Boot$.runImpl(Boot.scala:41)
at xsbt.boot.Boot$.main(Boot.scala:17)
at xsbt.boot.Boot.main(Boot.scala)
[error] java.lang.NoClassDefFoundError: sbt/TrackLevel
[error] Use 'last' for the full log.
Invalid response.</pre><br/>See complete log in <a href="file:/home/cybex/.IntelliJIdea2017.1/system/log/sbt.last.log">file:/home/cybex/.IntelliJIdea2017.1/system/log/sbt.last.log</a>

I have found none with the same issue.

What I tried:

I searched and found a similar issue, simply mentioning to delete the ~/.sbt and ~/.ivy2 folders. I did so, but it solved nothing.

I proceeded to reimport the same project, this time it redownloaded the sbt and ivy packages and showed the folder/project structure within IntelliJ's project window

When opening the sbt menu/tool and importing/refreshing all projects, the above shown importing error is printed again.

Question:

What is causing this, a missing library, a missing checkbox while importing?

Update:

I managed to get a project working by using the method described under PlayFramework 2.6.1 New application.

  1. I fired up a terminal, browsed to location of where my project needs to be, ran sbt new playframework/play-java-seed.g8, when prompted I entered the project name, organization, scala version, etc.

  2. I then opened intellij, imported this project (project name, inside where I ran the sbt new ... command), using SBT project model. After downloading and checking dependancies, it showed the project structure, although missing a few folders like sbt-build directory (seen this in example play project).

Opening the SBT Project toolbar, and clicking refresh, it has successfully imported all project and they were visible as expected.

Conclusion:

The documentation on Jetbrains IntelliJ website may be inaccurate, since my scala version was the same. Only difference was Java JDK version, I believe this needs to be confirmed.

1
Which sbt version are you using? - Salem
@Salem sbt 0.13.13 - CybeX

1 Answers

0
votes

I had the same issue with IntelliJ IDEA 2017.2.

But it doesn't happen with IntelliJ IDEA 2018.1.

I think you'd better update IntelliJ IDEA, and retry.