IntelliJ不识别PATH变量 [英] IntelliJ does not recognize PATH variable
问题描述
在我这样做之后,IntelliJ中出现了一条错误消息,说:
使用Gradle安装'/Users/myUser/Tools/gradle-1.3'无法获取类型BasicIdeaProject的模型。
构建文件'/Users/myUser/IdeaProjects/myProject/database/build.gradle'行:20
评估项目':database'时出现问题。
评估项目':数据库'时出现问题。在PATH中找不到
'play'命令。
确保您安装了Play Framework 2.0,并且在您的路径中
看起来,IntelliJ抱怨说我没有将播放框架添加到我的PATH变量。虽然从shell的输出告诉sth。其他:
echo $ PATH; / $ /bin:/sbin:/Users/myUser/.yadr/bin:/Users/myUser/.yadr/bin/yadr:/Users/myUser/Tools/gradle/bin:/usr/local/Cellar/mongodb/2.2。 2-x86_64 // bin:/ Users / myUser / Tools / groovy / bin:/Users/myUser/Tools/play-2.0
我还写了一个简单的类来显示IntelliJ使用的PATH变量:
public class Playground {
public static void main(String [] args){
System.out.println(System.getenv(PATH));
}
}
当我运行这个类,它给我以下输出:
/ usr / bin:/ bin:/ usr / sbin:/ sbin
看起来,IntelliJ完全忽略了在shell中设置的PATH变量。所以我想知道如何操作/配置IntelliJ来识别这个PATH变量?
我使用的shell是zsh。
提前感谢
查看这篇文章: http://emmanuelbernard.com/blog/2012/05/09/setting-global-variables-intellij/ 问题是IDEA没有读取你的 .zshrc
文件,不知道播放的路径。尝试在IDEA设置中手动设置PATH变量。
I recently tried to import an existing Gradle project, using the option "Open Project" in the startup window and the existing build.gradle file to automatically set-up the project.
Right after I did this, an error message appeared in IntelliJ, saying:
Could not fetch model of type 'BasicIdeaProject' using Gradle installation '/Users/myUser/Tools/gradle-1.3'. Build file '/Users/myUser/IdeaProjects/myProject/database/build.gradle' line: 20 A problem occurred evaluating project ':database'. A problem occurred evaluating project ':database'. 'play' command was not found in PATH. Make sure you have Play Framework 2.0 installed and in your path
As it looks like, IntelliJ complains that I did not add the play framework to my PATH variable. Although output from the shell tells sth. else:
echo $PATH;
/usr/local/bin:/Users/myUser/Library/Ruby/Gems/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/myUser/.yadr/bin:/Users/myUser/.yadr/bin/yadr:/Users/myUser/Tools/gradle/bin:/usr/local/Cellar/mongodb/2.2.2-x86_64//bin:/Users/myUser/Tools/groovy/bin:/Users/myUser/Tools/play-2.0
I also wrote a simple class to display the PATH variable used by IntelliJ:
public class Playground {
public static void main(String[] args) {
System.out.println( System.getenv( "PATH" ));
}
}
When I run this class, it gives me following output:
/usr/bin:/bin:/usr/sbin:/sbin
As it looks like, IntelliJ completely ignore the PATH variable set in the shell. So I'd like to know how to manipulate/configure IntelliJ to recognise this PATH variable?
The shell I am using is zsh.
Thanks in advance
Check this post: http://emmanuelbernard.com/blog/2012/05/09/setting-global-variables-intellij/ The problem is that IDEA doesn't read your .zshrc
file and doesn't know about path to play. Try to set PATH variable manually in IDEA settings.
这篇关于IntelliJ不识别PATH变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!