Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Error in sling Servlet

Avatar

Avatar
Validate 25
Level 3
Jai1122
Level 3

Likes

21 likes

Total Posts

127 posts

Correct Reply

2 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Jai1122
Level 3

Likes

21 likes

Total Posts

127 posts

Correct Reply

2 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Jai1122
Level 3

15-10-2015

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. 🙂

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 1
Employee
hypnotec
Employee

Likes

0 likes

Total Posts

1 post

Correct Reply

1 solution
Top badges earned
Affirm 1
View profile

Avatar
Affirm 1
Employee
hypnotec
Employee

Likes

0 likes

Total Posts

1 post

Correct Reply

1 solution
Top badges earned
Affirm 1
View profile
hypnotec
Employee

15-10-2015

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

Answers (2)

Answers (2)

Avatar

Avatar
Validate 25
Level 3
Jai1122
Level 3

Likes

21 likes

Total Posts

127 posts

Correct Reply

2 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile

Avatar
Validate 25
Level 3
Jai1122
Level 3

Likes

21 likes

Total Posts

127 posts

Correct Reply

2 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Boost 5
Boost 3
View profile
Jai1122
Level 3

15-10-2015

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

Avatar

Avatar
Validate 1
Level 2
Deepaks007
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Deepaks007
Level 2

Like

1 like

Total Posts

25 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
Deepaks007
Level 2

15-10-2015

Please share your entire code..