通过 Eclipse 的 SVN - 无法运行我签出的代码

发布于 2024-10-07 11:28:33 字数 228 浏览 1 评论 0原文

我在 Eclipse 中使用 SVN。我在工作区中将一个文件夹作为项目签出。我签出的文件夹有一个子文件夹“trunk”,在子文件夹“trunk”中我有我的 src 文件夹(和其他东西)。签出后,我尝试运行一个文件(JUnit 测试用例):我右键单击它并选择“运行为”,期望找到“作为 JUnit 测试用例运行”,但没有这样的选项。另外,Eclipse 似乎没有编译我的代码:我可以编辑代码,但没有收到任何自动完成或语法错误通知。我做错了什么?

I'm using SVN in Eclipse. I checked out a folder as a project in the workspace. The folder I checked out has a subfolder "trunk", and in the subfolder "trunk" I have my src folder (and other stuff). After checking out I tried to run a file (a JUnit test case): I right clicked on it and selected "run as", expected to find "run as a JUnit test case", but there wasn't such an option. Also, it looks like Eclipse doesn't compile my code: I can edit the code, but don't get any autocompletions or syntax error notifications. What have I done wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

那片花海 2024-10-14 11:28:33

啊,不知道为什么这花了我一段时间!检查主干上方的目录是事情变得不稳定的地方 - Eclipse 找不到项目文件 - 正如 HH 指出的那样,不知道源代码在哪里。

Ahh, not sure why this took me a while! Checking out a directory above the trunk is where things got wonky - eclipse couldn't find the project file - and as HH pointed out, didn't know where the source was.

风月客 2024-10-14 11:28:33

最有可能的是,Eclipse 无法弄清楚这个新项目:源文件夹在哪里,测试源文件在哪里等...这是由于项目文件丢失或损坏,该文件通常包含有关项目的元数据(它没有提交或者你没有检查)。

例如,为了获得自动完成和语法错误通知,Eclipse 必须将您的 Java 文件识别为源文件。在项目属性 -> Java 构建路径 -> 源中,确保源文件夹存在。

Most probably, Eclipse was not able to figure out in this new project: where is the source folder, where are the test source files etc... This is due to a missing or corrupted project file which would normally have metadata about the project (it wasn't committed or you didn't check it out).

For example, in order to get autocompletion and syntax error notifications, Eclipse must recognize your Java files as source files. In the project properties->Java Build Path->Source, make sure your source folder is present.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文