将自定义实用程序JAR添加到Windows系统路径



是否可以将实用程序jar添加到windows的系统路径?

我有findclass.jar,这是一个可执行的jar位于我的C:目录。
如果我打开cmd.exe,将目录更改为C:,并输入:
java -jar findclass.jar pathtojar.jar nameofclass.class
它将在另一个jar中搜索给定的类。

我如何添加findclass.jar到我的窗口的系统路径,所以我不需要改变目录C: ?
我试过set path=C:;%PATH%set path=C:findclass.jar;%PATH%
但是当我尝试从不同的目录执行它时,我得到Error: Unable to access jarfile findclass.jar

不能在路径中添加.jar文件吗?

添加到CLASSPATH环境变量中。

最新更新