BBdev
BBdev

Reputation: 4942

Eclipse not showing package which is already there

I got in the trouble i am making some packages in my application all fine now i want to make a folder inside the source is good but when i copy some images in that folder one of my package is not showing in the eclipse. and my work flow is like this

src/package1
src/package2
src/package3 
src/package4
src/folder/someimages there

Now in eclipse package explorer, If i want to give the same package name it is showing Package Already exist But i am not able to see the package in eclipse .... why its happening What should i do ... any help will be appreciated

UPDATE It was a mistake my package structure is like this...

src/package1 
src/package1/package2
src/package1/package3
src/package1/package4

....

Upvotes: 4

Views: 9047

Answers (3)

js_248
js_248

Reputation: 2122

Let us say you want to create file1.java in package src/package1 but it is not showing in workspace.
So go to package src/package1/package2 and create a new file with name file1.java but give the package name src.package1 inside this file.It will automatically create file1.java in src/package1 folder and this package will start be showing in workspace. for more information you can refer to http://www.coderanch.com/t/633775/java/java/eclipse-package-exists

Upvotes: 0

Rangi Lin
Rangi Lin

Reputation: 9461

The reason you can't see src/package1 is probably package presentation setting is set to flat. It will only display the packages that with files.

To change presentation, left click the arrow icon on your project explorer, change Package Presentation into Hierarchical.

Upvotes: 7

BBdev
BBdev

Reputation: 4942

I have Resolved this by the help of what @dinup Kandel said i just write a class in texteditor and pasted it inside my first package

And guess what the package was visible to me and i can add the class from eclipse there Thanks for the suggestion.... Thanks and regards

Upvotes: 0

Related Questions