简体   繁体   中英

src files not opening in Eclipse

I recently installed Eclipse. It opens and I create a new Java project. Then the project shows up on the side. I try to open it but the src file won't open.

  1. First, you must create a Java project

  2. Then, you can File > New > Add one or more classes to the project. This will implicitly create Java source file(s).

  3. Alternatively, you can add existing files to your project.

    If you're on Windows, one easy way to do this is to drag the file from Windows Explorer onto your Eclipse project.

  4. At this point, you should be able to compile and debug Java source.

Here is an excellent tutorial for getting started with the Eclipse IDE:

http://www.vogella.com/tutorials/Eclipse/article.html

PS: It's generally "good practice" to create a Java "package" under your Eclipse "src" folders, then create new classes/add new files under the package (instead of directly under "src").

That's because there are no files in the src folder. If you right click it then make a new file it will open up and list the file you created.

Right click SRC -> New -> File/Class

You have to create a file/class in the src folder to hold the instructions to perform your task.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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