0
votes

I have one application , where I am using one jar called "A" which internally refers to classes from another jar called "B", where jar "B" refers to classes from jar "C".

how to execute java application while setting class path to A.jar and add classpath dependency of B.jar and C.jar in manifest file of A.jar.

Thanks in advance

2

2 Answers

0
votes

You can set Class path in MENIFEST.MF file of A.jar like this

Class-Path : dependency/B.jar dependency/C.jar

where dependency is the folder which contains B and C jars

0
votes

You can specify classes to include in the Class-Path header field in the manifest file of an applet or application (A.jar in your case). The Class-Path header takes the following form:

Class-Path: jar1-name jar2-name directory-name/jar3-name

Reference: https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html