Can eclipse be configured to automatically fix missing Imports?

前端 未结 6 740
北海茫月
北海茫月 2020-12-08 02:18

Because they didn\'t make it easy enough already ;)

6条回答
  •  没有蜡笔的小新
    2020-12-08 03:02

    @Fabian's answer is correct if the class to be imported is already on the classpath for the java project or plugin.

    I'm not aware of a way to get Require-Bundle headers added(in the case of eclipse plugins) or package imports(in the case of osgi bundles) added automatically by Eclipse.

    What this means is that you can get what you want as long as you restrict the classes you add to those already on the classpath. However, if you try to start using a class that isn't already on your path, the organize imports aren't going to be able to help you.

提交回复
热议问题