Jar file ADD DIRECTORY ENTRIES Eclipse option while exporting jar

后端 未结 3 1902
名媛妹妹
名媛妹妹 2020-12-19 05:35

I don\'t whether I am asking correct question or not but want to clear my doubt.

Actually I came across the scenario of referring class files from jar file. I mean to

3条回答
  •  有刺的猬
    2020-12-19 06:18

    You should enable "Add directory entries" when creating jar files if you need to use class.getResource() method to get the URI of a particular directory inside your jar file. The reason why you may want to do this is to hold a URI to your "resource" folder for example.

    If you only use class.getResource() to get the URI of a specific file [and not a directory] then you will be fine if you leave the "Add directory entries" off.

提交回复
热议问题