Play Framework 2.4和IntelliJ Idea [英] Play Framework 2.4 and IntelliJ Idea

查看:563
本文介绍了Play Framework 2.4和IntelliJ Idea的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在IntelliJ中打开一个2.4项目,但由于事情发生了变化,我不知道该怎么做。

I am trying to open a play 2.4 project in IntelliJ but since things have changed I don't know how to do this.

在以前的版本中,我可以运行

In previous versions I could just run

activator idea

或者使用激活器UI并单击生成intelliJ项目,但在2.4中,idea命令似乎不存在

Or use the activator UI and click on generate intelliJ project, but in 2.4 the idea command doesn't seem to exist

[error] Not a valid command: idea (similar: eval, alias)
[error] Not a valid project ID: idea
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: idea (similar: clean)
[error] idea
[error]     ^

当UI点击生成intelliJ项目时,它会尝试编译应用程序并出现此错误:

And the UI seems broken, when I click on generate intelliJ project it tries to compile the app and gives this error:

play/Play$
java.lang.NoClassDefFoundError: play/Play$
Use 'last' for the full log.
Failed to load project.

我使用play java模板从头开始创建项目:

I created the project from scratch using the play java template with:

activator new

我也有尝试将文件夹导入为项目,但是intelliJ似乎没有将其识别为项目

I have also tried importing the folder as a project but intelliJ doesn't seem to identify it as a project

推荐答案

我遇到了同样的问题,因为我使用IDEA打开项目文件夹,它在子文件夹中有一个播放2应用程序,然后我导入模块(播放2应用程序)到系统。

I run into the same problem, as I used IDEA to open a project folder, it had an play 2 app in a sub folder, then I import module (play 2 app) to the system.

它运作良好。

之后我更改了模块文件夹名称,然后当我运行应用程序显示:

After that I have changed the module folder name, then when I run the app, it displayed:

Not a valid project ID: "project team"

我重新检查了文件夹,发现在文件 - >项目结构选项中,模块的名称是root,而团队 是整个项目的模块(不是SBT导入的模块),显然,在更改模块文件夹名称后,模块无法正常运行。

I re-checked the folder, and found that in the File -> Project Structure option, the name of module is "root", and the "team" is the module for whole project (not the module imported by SBT), so apparently, the module wasn't functional after I changed the module folder name.

所以我找到并删除所有.idea文件夹,这是IDEA配置,然后重新打开/重新导入模块,仍然无法正常工作。我认为这是IDEA缓存问题,它确实有已打开项目的缓存,所以我将项目文件夹从 team 更改为其他内容,清理.idea文件夹,然后重新打开/重新导入它。它工作正常。

So I found and removed all .idea folder, which is IDEA configureation, then re-open/re-import the module, still not work. I thought it's IDEA cache issue, it do have cache for the opened project, so I changed the project folder from team to something else, clean the .idea folders, and re-open/re-import it. It worked.

如果播放应用程序在项目文件夹中作为子文件夹,则在文件 - >项目结构中导入模块。

If the play app is in the project folder as a sub folder, to import the module at File -> Project Structure.

这篇关于Play Framework 2.4和IntelliJ Idea的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆