How can I disable star imports in Eclipse Juno? I only want to import the classes that I use, and the IDE imports the entire package if I import a lot of classes that are in that package.
Eclipse provide a shortcut CTRL + SHIFT + O, this shortcut command will remove all those unused imports from your code file.
1) Go to the line of unused import, press Ctrl + 1, which is an Eclipse shortcut of a quick fix. This will show a drop-down menu to fix this error and one of them will be "remove unused imports." It will remove that import statement from Java file.
To remove those unused imports automatically, just click on the class and press the shortcut “Ctrl + Shift + O” to initilize the “Organize imports” feature.
It's better to use the “Organize Imports” feature of Eclipse IDE to remove multiple or all unused imports statement. For using this from Menu, Select Source → Organize Imports. This will remove all unused imports from that Java file.
Preferences -> Java -> Code Style -> Organize Imports, then change Number of imports needed for .*.
If you change it to, say 2147483647
, you should be fine.
I just have Indigo here, but I think it will help you:
Go to Preferences -> Java -> Code Style -> Organize imports.
There you will have the following fields:
Number of imports needed for .*
Number of static imports needed for .*
You can change it to match your needs. The default in Eclipse Indigo is 99, which is probably a good number to avoid the .* import.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With