• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

compareToIgnoreCase() problem

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any pointers to this one?
Is there any other place Eclipse looks for JDK?
Thanks
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Jitesh Sinha
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jitesh,
Thanks for posting the solution! I'm glad to hear the problem is resolved.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic