William L.
William L.

Reputation: 3886

Import all imports in eclipse at once?

Okay, I recently started learning Java/Android so I look up a lot of tutorials and do a lot of copying/pasting, but most of the times the tutorial doesn't have the imports imported, so I have to go down the line clicking all the errors then Import this, import that, import something else! So... my question: Is there a way to import all of them at once?

Upvotes: 45

Views: 50295

Answers (5)

MAV
MAV

Reputation: 7457

On Windows you can use: Ctrl+shift+o which is a shortcut to Organize imports

On Mac it is Command+Shift+O (Thanks orip)

Upvotes: 102

prodeveloper
prodeveloper

Reputation: 950

alt(option) + enter(return) for Android Studio in mac system.

Upvotes: 0

segaurav
segaurav

Reputation: 217

Use: Ctrl+shift+L to see the list of shortcuts available

Upvotes: 11

alaster
alaster

Reputation: 4171

There are classes that have same name but do different work. See how many classes Date. At first time this looks not comfortably, but you will get used very fast. You can organize your imports automatickly, in NetBeans I use Ctrl+shift+i hotkey. There must be analog in other IDE`s.

Also importing a whole package (like this: java.util.*) is a bad practice

Upvotes: 2

Manuel Cantonero
Manuel Cantonero

Reputation: 135

You have some shortcuts on eclipse, look this page.

http://www.allapplabs.com/eclipse/eclipse_shortcuts.htm

I hope it help you, there you have the shortcuts named before for they and others more.

Sorry for mi English I hope it help you.

Upvotes: 2

Related Questions