can a class in a jar use a class in a different jar

后端 未结 3 961
失恋的感觉
失恋的感觉 2021-01-24 09:15

I am new to java so not sure I fully understand jar files.

I want to put some common code in a library jar, which I then use from applications that are in different jars

3条回答
  •  -上瘾入骨i
    2021-01-24 10:04

    This should be marked as a duplicate of this question I just came across

    It is the exact problem and solution, which I could not find with all my previous searching until I knew exactly what I was searching for, i.e. Executable JAR ignores its own Class-Path attribute

    So not a java problem at all but a maven problem and the usual sparse maven documentation sheds no light on the problem at all. Unfortunately the sample config I copied included the setting, which by default is turned off. Final solution, don't use indexing with the maven plugin.

提交回复
热议问题