Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to use default and static methods on interfaces w Eclipse Kepler / JDK 8?(JDK 8, Eclipse Kepler, default methods, static methods, interface)
icon5.gif  How to use default and static methods on interfaces w Eclipse Kepler / JDK 8? [message #1265072] Wed, 05 March 2014 18:21 Go to next message
Mark Sandstrom is currently offline Mark Sandstrom
Messages: 1
Registered: March 2014
Junior Member
In trying to do the examples at docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html, which "reflect features and conventions of the upcoming Java SE 8 release". The default methods and static methods per the code examples do not seem to be supported by the Eclipse Kepler compiler, even while I'm using the suggested "current JDK 8 snapshot from java.net.".

In particular, the following lines cause compiler errors:

    static ZoneId getZoneId (String zoneString) {...


--> error:
Quote:
Multiple markers at this line
- Abstract methods do not specify a body
- Illegal modifier for the interface method getZoneId; only public & abstract are permitted


Syntax error on token "default", delete this token


--> error:
Quote:
Syntax error on token "default", delete this token


Any ideas on how to get the default and static methods on the interface to compile?
Re: How to use default and static methods on interfaces w Eclipse Kepler / JDK 8? [message #1267439 is a reply to message #1265072] Sun, 09 March 2014 01:45 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan Herrmann
Messages: 1024
Registered: July 2009
Senior Member
No Java 8 feature can be supported by a released JDT compiler as long as Java 8 is not released.

See https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_%28BETA%29 for the latest bits (release candidate 2 as of yesterday).

Stephan
Re: How to use default and static methods on interfaces w Eclipse Kepler / JDK 8? [message #1349762 is a reply to message #1265072] Mon, 12 May 2014 10:36 Go to previous message
sam redway is currently offline sam redway
Messages: 1
Registered: May 2014
Junior Member
As of May 9 2014 you can now fully use the Java 8 features just download 'Eclipse Java 8 Support' from eclipse marketplace.
Previous Topic:Installing JRE programatically
Next Topic:Deploy slow using ejb3.1 and jpa in rational application developer
Goto Forum:
  


Current Time: Fri Oct 31 10:42:16 GMT 2014

Powered by FUDForum. Page generated in 0.01599 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software