java 'jar' 不被识别为内部或外部命令 [英] java 'jar' is not recognized as an internal or external command

查看:15
本文介绍了java 'jar' 不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 Windows 的命令行中运行jar"命令时出现以下错误:'jar' 未被识别为内部或外部命令

I'm getting the following error when I try to run the 'jar' command in the command line on windows : 'jar' is not recognized as an internal or external command

一般的解决办法好像是我需要在环境变量中将jdk bin文件夹添加到PATH中.我已经这样做了,我在路径变量中添加了以下内容:...;C:Program FilesJavajdk1.8.0_40in;

The general solution seems to be that I need to add the jdk bin folder to the PATH in environment variables. I have already done this, I added the following to the path variable : ...; C:Program FilesJavajdk1.8.0_40in;

虽然我不确定将 jdk 驻留在程序文件"而不是程序文件 x86"中是否会影响这一点.我在 64 位 Windows 上使用 64 位 java.谢谢

Though I'm not sure if having the jdk reside in 'program files' instead of 'program files x86' affects this. I'm on 64 bit windows with 64 bit java. Thanks

推荐答案

路径应该只包含操作系统将在其中查找可执行文件的目录.去除尾随的jar.exe"以将您的路径设置为:

The path should only contain directories where the OS will look for executables. Strip the trailing "jar.exe" to set your path as:

(此处为旧路径变量);C:Program Files (x86)Javajdk1.7in

(old path variables here);C:Program Files (x86)Javajdk1.7in

感谢:@stevevls

Thanks To : @stevevls

这篇关于java 'jar' 不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆