0

I tried with:

PATH=$PATH:/apps/abc/xyz/lib/*.jar
export PATH

But it won't work. I need to add each jar explicitly while running my code. Is there any way to add all jars in one folder and add that folder in -cp that will reduce effort of adding each jar explicitly.

Please Help..

Jahid
  • 21,542
  • 10
  • 90
  • 108

1 Answers1

0

It is possible there are a confusion between PATH and CLASSPATH.

PATH is used, at operating system level, to search for executable elements ("programs").

CLASSPATH is used, in Java environment, to search for java libraries (jars) and individual classes. CLASSPATH is an environment variable, "-cp" argument in "java", "javac", commands has a similar effect.

Reference:

https://docs.oracle.com/javase/tutorial/essential/environment/paths.html

pasaba por aqui
  • 3,446
  • 16
  • 40