Classpath including JAR within a JAR

前端 未结 13 1383
自闭症患者
自闭症患者 2020-11-22 02:21

Is it possible to specify a Java classpath that includes a JAR file contained within another JAR file?

13条回答
  •  情深已故
    2020-11-22 03:09

    You do NOT want to use those "explode JAR contents" solutions. They definitely make it harder to see stuff (since everything is exploded at the same level). Furthermore, there could be naming conflicts (should not happen if people use proper packages, but you cannot always control this).

    The feature that you want is one of the top 25 Sun RFEs: RFE 4648386, which Sun, in their infinite wisdom, has designated as being of low priority. We can only hope that Sun wakes up...

    In the meanwhile, the best solution that I have come across (which I wish that Sun would copy in the JDK) is to use the custom class loader JarClassLoader.

提交回复
热议问题