简体   繁体   English

如何在Windows 7中设置系统环境CLASSPATH变量

[英]How to set the system environment CLASSPATH variable in Windows 7

I am trying to set the CLASSPATH variable so that my java programs can access external jars. 我正在尝试设置CLASSPATH变量,以便我的java程序可以访问外部jar。 All the jars are in one directory and using the Java 1.6 wildcard feature, I currently have assigned the CLASSPATH variable to this value: 所有jar都在一个目录中并使用Java 1.6通配符功能,我当前已将CLASSPATH变量分配给此值:

C:\Program Files\Java\externaljars\*

Unfortunately, it doesn't seem to be working. 不幸的是,它似乎没有起作用。 Does anyone have any idea of what I am doing wrong? 有没有人知道我做错了什么?

I am running Windows 7. 我正在运行Windows 7。

Your classpath is bad. 你的类路径很糟糕。 You haven't to use the *. 你没有使用*。 If the directory of your external jars are in the C:\\Program Files\\Java\\externaljars you have just to add this path to your classpath like that: 如果外部jar的目录位于C:\\ Program Files \\ Java \\ externaljars中,则只需将此路径添加到类路径中,如下所示:

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

Try: 尝试:

C:\Program Files\Java\externaljars\*

Assuming externaljars is the directory that has all the jar files. 假设externaljars是包含所有jar文件的目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM