r/javahelp • • Dec 26 '16

I just downloaded the eclipse ide for java but.....?

When I use the scanner method it shows a red line underneath it as if it doesn't understand it.Is there something else I am supposed to download

0 Upvotes

5 comments sorted by

12

u/geekonamotorcycle Dec 26 '16

Did you import Java.util.scanner ?

2

u/Tagger24 Dec 26 '16 edited Dec 26 '16

This. There is also a neat keyboard shortcut that makes importing things very easy. Ctrl + Shift + O will import everything you need that you are using that is not part of the base package and remove anything that you imported that you aren't using. I find it super useful especially when working with Swing and using lots of different components.

If a class has a red line under it, try Ctrl + Shift + O. If that doesn't work then check your spelling. If it's a class you wrote yourself there might be a little bit more to it.

1

u/geekonamotorcycle Dec 26 '16

Didn't know that, awesome!

5

u/[deleted] Dec 26 '16 edited Sep 27 '17

deleted 0.7078 What is ^^^this?

1

u/96-62 Dec 26 '16 edited Jan 04 '17

Do you have a jvm configured? I can't remember whether you need to import Scanner.