• Post Reply Bookmark Topic Watch Topic
  • New Topic

what is wrong with this code ?  RSS feed

 
Badri Narayanan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


When i try to save the code in eclipse for Test1.java under package pack iam getting file name collision error.Aren't the class names and the interface names in java case sensitive ?
Thanks
-Badri
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, they are. But Windows is NOT case sensitive, if that is the OS you are using.
 
Badri Narayanan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Fred
 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

what Fred wrote cannot be the cause.

I'm using Eclipse 3.1 in WindowsXP and had no problems to put Test1 and test1 into one file named Test1. Maybe you have already a class or interface with that name(s) in this package?

Try to make a variable Test1 xy; or test1 yz;
If there's already such a class it will work, otherwise Eclipse marks this as "cannot be resolved to a type".

Consider the class can be in a file with different name and does not necessarily occur in the package explorer of eclipse.


Yours,
Bu.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assumed that the class Test1 was in one file named "Test1.java", and that the interface was defined in a second file name "test1.java". My assumption may not have been correct.

if not, then yes, I would make sure there isn't already a previous test1.java file from some other project out there.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The two class files would have the same name, too, so if they're in the same package, regardless of the source file names, on Windows one file will clobber the other. It may seemingly work in Eclipse, but you'll fail to be able to deploy the application.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!