Exclude packages from Eclipse's organize imports

Go To StackoverFlow.com

4

There are certain classes, such as Closeable, File and Container, that have doppelgänger classes in obscure packages that I am extremely unlikely to ever use. Normally, that wouldn't be an issue, but when I Organize Imports I have to manually select the correct type to import. Is there any way to exclude specific packages from the Organize Imports tool?

Eclipse Version:
Version: 3.7.1
Build id: M20110909-1335

2012-04-04 21:44
by Jeffrey


7

I don't see, for example, the com.sun.*.Closeable in your example when I use ContentAssist or Organize Imports. I think where you want to configure it is in Preferences > Java > Appearance > Type Filters. However, I don't have com.sun.* listed in my filter list. Maybe it's the "Hide forbidden references" option.

enter image description here

2012-04-04 21:59
by E-Riz
Weird, my Hide forbidden references was checked too. But this is indeed what I was looking for. Thanks - Jeffrey 2012-04-04 22:04
Ads