PostConstruct 不再可用

PostConstruct no longer available

我使用了当前版本的 Eclipse 和 Java。 我尝试将我的 RCP 应用程序从 Java 8 移动到 Java 11。我的应用程序运行但现在我遇到了功能问题,因为我必须删除 @PostConstruct 注释来自我的代码。

此注入注释是否存在任何其他替代方法?

对于 Eclipse e4,PostConstruct 注释位于 javax.annotation 插件中。将其添加为插件的依赖项并继续使用 PostConstruct。