0

I have two different JAR files, dependent.jar and independent.jar

dependent.jar gives a java.lang.NoClassDefFoundError when run, and requires classes from independent.jar to execute successfully. However, I cannot figure out a way to include independent.jar in the class path of dependent.jar

I tried using the command java -cp independent.jar -jar dependent.jar
However, the -cp option is ignored when used with -jar option.

trixter_dj
  • 13
  • 2
  • 1
    Does this answer your question? [Differences between "java -cp" and "java -jar"?](https://stackoverflow.com/questions/11922681/differences-between-java-cp-and-java-jar) – Piotr Apr 30 '21 at 22:02
  • Does your `dependent.jar` have a manifest with a `Class-Path` entry? – Mark Rotteveel May 01 '21 at 07:38

0 Answers0