Skip to main content



      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 13:21 Go to next message
Eclipse UserFriend
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] Sat, 08 March 2014 20:45 Go to previous messageGo to next message
Eclipse UserFriend
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 06:36 Go to previous message
Eclipse UserFriend
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: Thu Apr 17 19:49:19 EDT 2025

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

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

Back to the top