简体   繁体   中英

Subclipse Expands Packages into Folders (Eclipse, Java, SVN)

I have a SVN repo for my Java project. I want to synchronize both my computers, so I commit it from Eclipse with Subclipse. I then pull it from my other computer to Eclipse using Subclipse (Brand new, this project did not exist on the other computer), and it appears to have inflated the package into its respective folders. (Example: foo.bar.baz.myProject is expanded to foo/bar/baz/myProject instead of keeping in the package structure). Does anyone know how to get the package view back? Thanks.

This is just a view option in Eclipse. Set your package presentation style to flat :

如何解决它

If you are missing the Package Explorer itself, you can get it back under Window->Show View->Package Explorer

You might also want to check if your project is a Java project. If not, reimport it as a Java project and you might be already fine.

What's happening is that eclipse is not recognizing your project as a java project. Java project's get special treatment with regard to packages / folders. Make sure you've checked in (and out) your .project file at the top project level. Note, in the package explorer view, you may not see .* files by default. There's a down arrow you can click on there to adjust the filtering and unhide .* files.

Otherwise, you can create a test java project in your other (2nd computer) and copy over the needed elements into your .project file.

Lastly, make sure you're in the packages explorer in eclipse. There are several views for viewing your project.

It sounds like you've imported the code as a standard project, rather than a Java project. Normal projects don't show the package hierarchy in the project explorer.

Follow the steps in this link to convert to a Java project.

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