0

I am making a maven project which contains a dependency with runtime scope. I want to call this jar class directly from command line. I don't have the option to make fat jar. My Jar structure is:-

one.jar
--- temp.class
.....
.....
/lib/two.jar
/lib/three.jar

suppose I want to call Temp1 class of two.jar directly from the command line.

Milad Bahmanabadi
  • 946
  • 11
  • 27

2 Answers2

0

java -cp "path" "classname"

eg : java -cp C:\one.jar com.test.main.temp

OR

java -cp /usr/local/jar/one.jar:/some/other/two.jar com.your.main.classname

Khal Drogo
  • 41
  • 3
0

you could place a "proxy" class in one.jar which delegates to the target class in your embedded two.jar

Marc Stroebel
  • 2,295
  • 1
  • 12
  • 21