aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes compareToIgnoreCase() problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "compareToIgnoreCase() problem" Watch "compareToIgnoreCase() problem" New topic
Author

compareToIgnoreCase() problem

Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
My IDE is eclipse 3.0 .
I am using compareToIgnoreCase() method of String class which was introduced in jdk 1.4.
I have specified jdk version as 1.4 by specifying all the options inside Project->properties->Java Compiler->Compliance and classfiles:
Compiler compliance level 1.4
have unchecked the checkbox Use default compliance settings
Generated .class files compatibility 1.4
Source compatibility 1.4

Same thing is seen on Windows->preferences dialog box as well.

The eclipse IDE is pointing jdk 1.4.2 as done by pointing windows->preferences->installed jres to the jdk 1.4.2.

But eclipse shows the error the method compareToIgnoreCase not found in Type String.
Note that same code compiles without any problem in the other IDE with the same settings of JDK.
[ February 16, 2005: Message edited by: Jitesh Sinha ]
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
Any pointers to this one?
Is there any other place Eclipse looks for JDK?
Thanks
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30929
    
158

Jitesh,
Can you try using the new assert keyword? It may give a clue if Eclipse is finding 1.4 libraries, keywords or neither.

Everything you are doing sounds right though.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
I uninstalled eclipse 3.0 and installed it(the same version) again.This time I was able to run eclipse by double-clicking on eclipse.exe.Previously,I had to issue a command at DOS prompt.
After that,I started from writing a HelloWorld program inside a new project.
I could use compareToIgnoreCase() method inside main() method.
Then I went ahead and added another project for my real application and added all the pre-existing files.But compareToIgnoreCase() method is not identifiable here.
So I have two projects in my workspace :1.)HelloWorld -> compareToIgnoreCase() method works here.
2.)My app project ->compareToIgnoreCase() method does not work.

People,eclipse is giving me sleepless nights.
Any idea how to resolve the above problem?I have checked the classpath variables of both the projects.Both are pointing to the same JAVA_HOME.
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
I removed JRE itself from project->properties->Java Build Path->Libraries for my app project.
Now I see a couple of problems.It is not able to identify the java.sql package and ArrayList class.I mean if JRE itself is not there I should have seen whole lot of many more problems like not identifying any keywords etc.Eclipse identifies everything except the above mentioned packages/classes.It means that eclipse is finding JRE from somewhere else which is absolutely absurd!
What a pain !!
Now anyone please tell me where eclipse is going to see JRE libraries.
[ February 18, 2005: Message edited by: Jitesh Sinha ]
Jitesh Sinha
Ranch Hand

Joined: Jun 19, 2004
Posts: 146
Never mind,solved this problem.Removed all the libraries from build path.Then added them as errors came one-by-one for missing libraries.And it worked!
Could not have dreamt that eclipse is so intelligent!!!
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30929
    
158

Jitesh,
Thanks for posting the solution! I'm glad to hear the problem is resolved.
 
wood burning stoves
 
subject: compareToIgnoreCase() problem