This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes IDEs, Version Control and other tools and the fly likes Problems regarding Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Problems regarding Eclipse" Watch "Problems regarding Eclipse" New topic
Author

Problems regarding Eclipse

Nitya Sundar
Greenhorn

Joined: Nov 13, 2012
Posts: 15
please help me?when ever i am creating a class in a project folder every time it is showing two class file(.java file) with the same name..how to resolve this problem?for example if i create class A then Eclipse is creating the same class A below it with the same name as class A.thanks in advance...
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
it must be in different folder. Eclipse has concept of showing contents under soruce folder, plus you can the same in real folder (with different name)

Add a snapshot will illustrate your problem clearly.


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Nitya Sundar
Greenhorn

Joined: Nov 13, 2012
Posts: 15
please bear me if any mistake i have done over here as i am new to this forum.you can see here the same Demo.java file is automatically created.and if you delete the one than the other one also get deleted.i need only single java file.



[Thumbnail for Capture.PNG]

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

This is an artifact of the way Eclipse displays source files. It lets you see the file within a directory structure (the Demo.java you have highlighted), and it also presents a view where source files are grouped by package (the Demo.java within the "(default package)" group. These are just two views of the exact same file.

I don't know why you don't also see A.java twice: it could be due to the type of project you created, or it could be due to the fact that you are creating classes without packages (which is frowned upon, you should always have a package statement as the first line of your source file.)


JBoss In Action
Nitya Sundar
Greenhorn

Joined: Nov 13, 2012
Posts: 15
Thanks Peter.I just wanted to know why it was showing.
 
Consider Paul's rocket mass heater.
 
subject: Problems regarding Eclipse