Error in sling Servlet | Community
Skip to main content
Jai1122
New Participant
October 16, 2015
Solved

Error in sling Servlet

  • October 16, 2015
  • 3 replies
  • 1162 views

I tried using java datetimeformatter for some date manipulation in a sling servlet and ended up with the following error. I think the import statement is also correct. [import java.time.format.DateTimeFormatter;]

Error : 

Only a type can be imported. java.time.format.DateTimeFormatter resolves to a package

 

Request your suggestions. Thanks in advance. :)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by jaeggid

this class is only available since java 1.8 - are you running AEM on java 1.8?

3 replies

New Participant
October 16, 2015

Please share your entire code..

jaeggidAccepted solution
Employee
October 16, 2015

this class is only available since java 1.8 - are you running AEM on java 1.8?

Jai1122
Jai1122Author
New Participant
October 16, 2015

That's the mistake. Thank you for pointing it!!