hi i have written one shell script which is performing 1 task.
java -jar abc.jar $* -adminid $j_username
before this command i want to set classpath(or want to refer) of all jars which are in particular lib folder, how to do that?
hi i have written one shell script which is performing 1 task.
java -jar abc.jar $* -adminid $j_username
before this command i want to set classpath(or want to refer) of all jars which are in particular lib folder, how to do that?
set CLASSPATH=pathtojars1;pathtojars2
before your java command.
Or:
java -classpath
One way to do it would be:
set CP=abc.jar:someother.jar
java -cp $CP your.main.Class $* -adminid $j_username
It is worth while to note that when using -jar
you can't specify other JARs/resources on the classpath i.e. -cp
switch is ignored hence you would have to choose between the two.
-jar
specify the main
class when running the program