所以我有这个问题,无法自己找到解决方案。 我相信我已经正确设置了IDEA,因为当我启动一个新项目并使用提供的模板时,我可以添加自己的代码并运行正常!
但是,当我尝试从包中编译的教程(com.exmaple.java)中打开一些示例代码时,问题就出现了,例如教程材料目录:C:\ Users \ Edgar \ Desktop \ Ex_Files_JavaEssT_Q32015 \ Exercise Files \ Ch04 \ 04_03 \货币的\ src \ COM \例子\ java中。
我试过打开curency部分,src部分和文件本身,但没有任何作用,我无法运行这些教程的代码。 查看我的想法的截图 。
so i have this problem and cannot find solution on my own. I believe i have set up IDEA correctly , because when i start a new project and use the provided template i can add my own code and run it fine!
However the problem happens when i am trying to open some example code from tutorials that are compiled in packages ( com.exmaple.java) e.g of tutorial material directory: C:\Users\Edgar\Desktop\Ex_Files_JavaEssT_Q32015\Exercise Files\Ch04\04_03\Currency\src\com\example\java.
I have tried opening on the curency part , the src part and the files themselves but nothing works and i cannot run code of these tutorials. See screenshot for my Idea.
最满意答案
我想你应该将“src”目录标记为Sources Root。 只需右键单击“src”目录,选择Mark Directory as - > Sources Root
用于标记目录的上下文菜单
I guess that you should mark the "src" directory as Sources Root. Just right click the "src" directory, choose Mark Directory as -> Sources Root
The Context menu to mark the directory
更多推荐
发布评论