Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude packages from Eclipse's organize imports

Tags:

java

eclipse

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

like image 835
Jeffrey Avatar asked Feb 20 '23 22:02

Jeffrey


1 Answers

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

like image 127
E-Riz Avatar answered Mar 04 '23 13:03

E-Riz