Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java 6 method not being recognised
Java 6 method not being recognised [message #708010] Tue, 02 August 2011 06:35 Go to next message
Ash McConnell is currently offline Ash McConnell
Messages: 4
Registered: July 2009
Junior Member
Hi Folks,

I have installed the latest 1.6 JDK and set eclipse to use it's JRE, but File.setReadable does not compile. Can anyone think of why that would be the case?

Have I missed something in the config / prefs?

Thanks for your help
All the best,
Ash
Re: Java 6 method not being recognised [message #708039 is a reply to message #708010] Tue, 02 August 2011 07:26 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
On 02.08.2011 12:35, Ash McConnell wrote:
> Hi Folks,
>
> I have installed the latest 1.6 JDK and set eclipse to use it's JRE,
> but File.setReadable does not compile. Can anyone think of why that
> would be the case?
>
> Have I missed something in the config / prefs?
Your Java project probably has a different JRE on its Java Build Path.

Dani
>
> Thanks for your help
> All the best,
> Ash
Re: Java 6 method not being recognised [message #708044 is a reply to message #708039] Tue, 02 August 2011 07:33 Go to previous message
Ash McConnell is currently offline Ash McConnell
Messages: 4
Registered: July 2009
Junior Member
Thanks Dani,

I have just realised what the problem is, It's because Android have implemented the standard java.io.File class and didn't bother allowing File.setReadable until API level 9 (I am using API level 8 ).

See here for details: - developer.android.com/reference/java/io/File.html#setReadable(boolean)

(Sorry can't post links until i've posted 5 msgs)

All the best,
Ash

[Updated on: Tue, 02 August 2011 07:39]

Report message to a moderator

Previous Topic:FIELD_ACCESS in org.eclipse.jdt.core.dom.FieldAccess *Strange behaviour
Next Topic:What is an efficient way of finding the classes in a project using Eclipse's JDT?
Goto Forum:
  


Current Time: Fri Aug 01 08:11:43 EDT 2014

Powered by FUDForum. Page generated in 0.01651 seconds