-1

I am using Eclipse in Ubuntu Linux.

For some reason some classes are simply not found, for example Comparator or Arrays.

I have noticed something very strange. When I view the library in Eclipse I can see that most .class files allow you to click on them and it displays a 'C' icon - for example 'Comparators' in the screenshot below. Comparator does not allow this dropdown - could this be part of the problem? The same also goes for Arrays.class and BitSet.class, as you can see.

enter image description here

Why the hell can I not reference Comparator in the IDE??

Armada
  • 718
  • 8
  • 19
  • are you able to get comparator class using command prompt – Panther Dec 08 '14 at 17:51
  • When you say 'get it' what do you mean. Is that .class file there or can I actually link to the Comparator class? – Armada Dec 08 '14 at 17:54
  • i mean are you able to use Comparator class, by running some simple program. Just want to make sure it jdk issue or IDE – Panther Dec 08 '14 at 17:57
  • I can compile and run a program using Comparator in the command line. – Armada Dec 08 '14 at 18:03
  • 2
    Well, you didn’t name the *version* of Eclipse but the problem sounds much like [you have to update your Eclipse version](http://stackoverflow.com/a/26105217/2711488). `Comparator` has even both, `static` *and* `default` methods. – Holger Dec 08 '14 at 20:46

1 Answers1

0

It turned out that, as @Holger suggested, this was a problem with my version of Eclipse. I was running Eclipse Indigo. Once I updated to Eclipse Luna the strange compilation errors were fixed. I was also able to change the compiler compliance level to 1.8 and make use of JDK 8 constructs such as the Lambda, which I was unable to do in Indigo.

Armada
  • 718
  • 8
  • 19