简体   繁体   English

Eclipse在我的src文件夹中看不到任何内容

[英]Eclipse doesn't see anything in my src folder

I've been trying to use a helpful tool called Forge. 我一直在尝试使用一个名为Forge的有用工具。

It comes with the src folder and everything it really needs. 它带有src文件夹以及它真正需要的一切。 I set up Eclipse, using the workspace as the src folder inside of the development folder. 我使用工作空间作为开发文件夹内的src文件夹来设置Eclipse。 When Eclipse restarts, nothing is in the package explorer. Eclipse重新启动时,程序包浏览器中没有任何内容。 I feel like I am doing something wrong. 我觉得我做错了什么。 I have had other friends do the same thing, and it somehow worked for them. 我有其他的朋友也做同样的事情,并且它对他们有用。 We are all using Eclipse Kepler, as well as the other friends. 我们都在使用Eclipse Kepler,以及其他朋友。 This version is easier to use, as it's STRICTLY (SOMEWHAT, apparently, which is based on the low amounts of research I did, but the high amounts that others have done. Thanks guys, :D) made for Java. 这个版本更易于使用,因为它是严格的(显然是基于我所做的少量研究,但是其他人已经完成了大量的研究。谢谢,:D)基于Java的版本。

EDITED AND FIXED: Okay! 编辑并修复:好的! I just figured out that Paul Crotty up there was right, I just messed up the paths. 我只是想知道Paul Crotty在那儿是对的,我只是弄乱了路径。 I literally went all hacker typer on this thing, and it worked. 实际上,我对所有的黑客打字机都使用了这种工具,它确实有效。 @Paul Crotty @保罗·克罗蒂

From the documentation , always a good place to start, it says ... 文档开始 ,总是一个不错的起点,它说...

When you open Eclipse, when it asks to select a directory for your workspace, point it at the forge/mcp/eclipse folder in your forge directory. 当您打开Eclipse时,当它要求选择工作区的目录时,请将其指向您的forge目录中的forge / mcp / eclipse文件夹。

For advanced user only: Instead you can also create a new Java Project with the location forge/mcp/eclipse/Minecraft and adjust the the PATH variables of your project. 仅限高级用户:相反,您也可以使用forge / mcp / eclipse / Minecraft位置创建一个新的Java项目,并调整项目的PATH变量。

No, no need to use the src folder as workspace. 不,不需要将src文件夹用作工作空间。 Put it somewhere else, cause every project you make will end up in the src folder and most likely mess up everything. 将其放在其他位置,因为您创建的每个项目都将最终出现在src文件夹中,并且很可能使所有内容混乱。 When you get a different workspace, import the src folder. 当您获得其他工作空间时,请导入src文件夹。 Then it should work. 然后它应该工作。 If you need help, just ask in the comments! 如果您需要帮助,请在评论中提问!

While I am not a Minecraft player, I do know a few things about Eclipse. 虽然我不是Minecraft玩家,但我确实了解Eclipse的一些知识。

I recommend trying the Import feature. 我建议尝试导入功能。 From the Workspace/Package Explorer on the far left-hand side on the IDE, you can right click on the directory (usually the *package) into which you would like to import files and select the import option OR you can single lick on the same directory and go to the above toolbar File->Import. 在IDE最左侧的Workspace / Package Explorer中,您可以右键单击要将文件导入到的目录(通常为* package),然后选择导入选项,或者单击一下。相同目录,然后转到上面的工具栏“文件”->“导入”。

Once the import window opens, make sure to select General->File System. 导入窗口打开后,请确保选择“常规”->“文件系统”。 Then Browse to the directory where your files are stored. 然后浏览到存储文件的目录。 (The path is usually something like 'C:\\User\\UserName\\workspace\\Project_Name\\src\\package_name' on a Windows machine OR '/home/username/workspace/Project_name/src/package_name' on a Linux machine). (路径通常类似于Windows计算机上的'C:\\ User \\ UserName \\ workspace \\ Project_Name \\ src \\ package_name'或Linux计算机上的'/ home / username / workspace / Project_name / src / package_name')。 Click 'OK' on bottom right-hand side. 点击右下角的“确定”。 Then select the files or **packages you want to import! 然后选择您要导入的文件或文件包!

*You may want to create a package as it is not recommended to store files in the 'default-package' created with most new Projects. *您可能要创建一个包,因为不建议将文件存储在大多数新项目创建的“默认包”中。 (If you need to do this, you can right click on the src folder underneath the Project_Folder found in the Workspace/Package Directory and then go to New->Package. Name the package and your set!) (如果需要执行此操作,可以右键单击在Workspace / Package目录中找到的Project_Folder下的src文件夹,然后转到New-> Package。为程序包和您的集合命名!)

**Selecting a package will automatically import all files in that directory. **选择一个软件包将自动导入该目录中的所有文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM