[2.1] Intellij IDEA with "hello world" sample not working

893 views
Skip to first unread message

David F

unread,
Apr 9, 2013, 9:09:25 AM4/9/13
to play-fr...@googlegroups.com
I have Intellij Ultimate 12.1 installed with scala, sbt, play framework plugins.
Using Play framework 2.1.1 and Scala 2.10

I am trying to import the "hello world" sample after executing the "idea" command:

$ idea with-sources=yes sbt-classifiers

also tried

$ idea with-sources=yes

They all give the same errors under the " target/scala-2.10/src_managed/main/controllers/routes "

java: /Users/df/sdev/play/helloworld/target/scala-2.10/src_managed/main/controllers/routes.java:8: cannot find symbol
symbol  : class ReverseApplication
location: package controllers

java: /Users/df/sdev/play/helloworld/target/scala-2.10/src_managed/main/controllers/routes.java:11: package controllers.javascript does not exist

java: /Users/df/sdev/play/helloworld/target/scala-2.10/src_managed/main/controllers/routes.java:15: package controllers.ref does not exist


How can I fix this?  

Also, it would be nice if the play framework documentation had more explicit steps how to import a sample into Intellij IDEA.

TIA

David

Alban Dericbourg

unread,
Apr 9, 2013, 9:20:10 AM4/9/13
to play-fr...@googlegroups.com
I just tried with example supplied with Play! 2.1.1 and I did not have any issue:

me@MYMACHINE:/my/workspace/helloworld$ play
[info] Loading project definition from /my/workspace/helloworld/project
[info] Set current project to helloworld (in build file:/my/workspace/helloworld/)
       _            _
 _ __
| | __ _ _  _| |
| '_ \| |/ _' | || |_|
|  __/|_|\____|\__ (_)
|_|            |__/

play
! 2.1.1 (using Java 1.6.0_39 and Scala 2.10.0), http://www.playframework.org

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[helloworld] $ idea with-sources=yes
[info] Trying to create an Idea module helloworld
[info] Updating {file:/my/workspace/helloworld/}helloworld...
[info] Done updating.                                                        

   
[many warnings...]

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[info] Excluding folder target
[info] Created /my/workspace/helloworld/.idea/IdeaProject.iml
[info] Created /my/workspace/helloworld/.idea
[info] Excluding folder /my/workspace/helloworld/target/scala-2.10/cache
[info] Excluding folder /my/workspace/helloworld/target/resolution-cache
[info] Excluding folder /my/workspace/helloworld/target/streams
(commons-codec_commons-codec_1.6_test,List(commons-codec_commons-codec_1.3))
(org.apache.httpcomponents_httpcore_4.1.3_test,List(org.apache.httpcomponents_httpcore_4.0.1))
(org.apache.httpcomponents_httpclient_4.1.2_test,List(org.apache.httpcomponents_httpclient_4.0.1))
[info] Created /my/workspace/helloworld/.idea_modules/helloworld.iml
[info] Created /my/workspace/helloworld/.idea_modules/helloworld-build.iml
[helloworld] $

After doing the previous step (launchin idea with-sources=yes), you just need to import it using: File, Open, select the path of your project (eg. /my/workspace/helloworld).
Then you might want to install the Play! 2 plugin but this is not required to work with a Play! project.

David F

unread,
Apr 9, 2013, 2:44:48 PM4/9/13
to play-fr...@googlegroups.com
Thank you....

I had to take out a reference to load .sbt/plugins

and that fixed most of the errors, but I still have one which I can't decipher and understand and moreover is referring to Scala 2.9.2 which I am not using (but rather 2.10)

scala: Output path /Users/df/sdev/play/helloworld/project/target/scala_2.9.2 is shared between: Module 'helloworld-build' production, Module 'helloworld-build' tests
Currently external Scala compiler prohibits output path sharing.
Either disable the external build mode or configure separate output paths.
TIP: you can use Project Artifacts to combine compiled classes.

TIA

Volker Hatz

unread,
Apr 10, 2013, 7:37:06 AM4/10/13
to play-fr...@googlegroups.com
A common issue is that due to some - at that time valid - old blog entries developers are advised to set up a project in intellij and then import the play project. After having run "idea with-sources=true" you can simply open the project and everything should run out of the box as Alban verified. There is no need to setup a project in intellij first.

Volker

David F

unread,
Apr 10, 2013, 9:03:02 AM4/10/13
to play-fr...@googlegroups.com
Hi Volker,
Thank you for the reply but I did not create a project first.  (Rather I had deleted the old non-working "hello world" project from Intellij).

Is there a way to get a diagnostic log to figure out what is happening in my case?  I don't even understand the error message or why it is referencing Scala 2.9.2 when I am using 2.10.1 (which is also what Play 2.1.1 is using)

TIA

Volker Hatz

unread,
Apr 10, 2013, 9:27:50 AM4/10/13
to play-fr...@googlegroups.com
Hmm ... I am on travel and have limited capabilities to check things.
- Are you sure that Intellij was closed when you generated idea with-sources=yes? Just asking ...
- I am sure that I have external build mode enabled in Intellij. So it has no idea of any settings within Intellij that could deteriorate it

Volker
--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/AoFzUPnPMco/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages