weixin_39662834
weixin_39662834
2020-12-27 03:46

[bndtools] Ensure Bnd Bundle Path is not put on modulepath

Following up from a discussion on bndtools-users (https://groups.google.com/forum/#!msg/bndtools-users/l9tSpCLFbGw/WDRFgGFCBwAJ):

On later versions of Eclipse, the "new Java project wizard" has a third page added which asks you if you want to create a module-info.java. Bndtool's NewBndProjectWizard inherits from JavaProjectWizard, and so this third page also gets presented to the user.

If you answer "Yes" to this question, the the wizard will add the Bnd Bundle Path container to the modulepath rather than the classpath, which causes Eclipse's built-in compiler to fail to find some classes on -buildpath, which display as errors in the source editor. However, the BndtoolsBuilder ignores this setting and so it will still successfully compile and generate the bundle, and there will be no corresponding error markers in the Project Explorer or the Problems tab.

It would be handy to fix NewBndProjectWizard so that doesn't put the Bnd Bundle Path container into the modulepath under any circumstances.

该提问来源于开源项目:bndtools/bnd

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39662834 weixin_39662834 4月前

    Alternatively, maybe we should have a policy that Bnd projects simply should never (or rarely) have a module-info.java class, and should use the -jpms-module-info instructions to generate module-info.class. In which case, the New Bnd Project wizard should simply suppress the dialog that asks if it should create a module-info.java.

    点赞 评论 复制链接分享
  • weixin_39931390 weixin_39931390 4月前

    We interestingly had something similar yesterday. The funny thing was, that the errors only showed in the editor itself but not on the Project in the Project Explorer. Bndtools was building and launching everything without complaint.

    点赞 评论 复制链接分享
  • weixin_39963255 weixin_39963255 4月前

    In the PDF & videos I made I told people to explicitly disable it. Things get hairy on >8 Java.

    点赞 评论 复制链接分享
  • weixin_39963255 weixin_39963255 4月前

    I did a quick test. If I remove the Java buildpath setup page, you can never set anything.

    The original design was to have no Java project setup. However, during one release the wizard crashed with an NPE if we skipped that page. That seems to be fixed.

    I suggest we remove this page?

    点赞 评论 复制链接分享
  • weixin_39812465 weixin_39812465 4月前

    I suggest we remove this page?

    Sure. Lets try it and see how it goes.

    点赞 评论 复制链接分享
  • weixin_39963255 weixin_39963255 4月前

    ok

    点赞 评论 复制链接分享

相关推荐