Skip to main content
Jai1122
Level 4
Oct 16, 2015 2:28 AM UTC
Solved

Error in sling Servlet

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.
jaeggidAccepted solution
Adobe Employee
Oct 16, 2015 2:28 AM UTC

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

3 replies

Jai1122
Jai1122Author
Level 4
Oct 16, 2015 2:28 AM UTC

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

Translate
jaeggidAdobe EmployeeAccepted solution
Adobe Employee
Oct 16, 2015 2:28 AM UTC

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

Translate
Level 2
Oct 16, 2015 2:28 AM UTC

Please share your entire code..

Translate