How to set the CLASSPATH variable in a system environment in Windows 7

I am trying to set the CLASSPATH variable so that my java programs can access external banks. All banks are in the same directory and using the Java 1.6 wildcard function, I have currently assigned the CLASSPATH variable to this value:

C:\Program Files\Java\externaljars\* 

Unfortunately, it does not work. Does anyone have an idea of ​​what I'm doing wrong?

I am running Windows 7.

+4
source share
2 answers

Your path to class is bad. You should not use *. If the directory of your external jars is located in C: \ Program Files \ Java \ externaljars, you should simply add this path to your class path as follows:

CLASSPATH = .; "C: \ Program Files \ Java \ externaljars";

+3
source

Try:

 C:\Program Files\Java\externaljars\* 

Assuming externaljars is a directory that has all jar files in it.

-2
source

Source: https://habr.com/ru/post/1303227/


All Articles