[英]how to run a java program in command prompt
如何在控制面板中设置路径。我一直在尝试更改环境变量中的路径,但无法成功。它指出的错误是javac无法识别为内部或外部命令可操作程序或批处理文件
Ok,here's what you gotta do. 好的,这就是你要做的。 Go to the bin folder where you have java installed.
转到安装了Java的bin文件夹。 If you havent changed the path during installation, it should be this path:
如果在安装过程中未更改路径,则应为以下路径:
C:\\Program Files\\Java\\jdk1.7.0_51\\bin C:\\ Program Files \\ Java \\ jdk1.7.0_51 \\ bin
Do confirm anyway, as the version may differ & so will the folder name. 无论如何都要确认,因为版本可能有所不同,文件夹名称也会有所不同。
Copy this path, including bin.Now, 复制此路径,包括bin。现在,
->right click on My computer, go to Properties.
->Select Advanced System Settings
->Click on Environment Variables
->Under System Variables,select path, & then click on edit.
->keep the previous path as it is,add a semicolon after that & paste the path you copied earlier.
Click ok/apply & you're done.Now you can run all java commands from any directory on your computer.Once again, dont remove the existing path, you gotta add this new one to the existing one,seperate using semi-colon. 单击“确定” /“应用”,操作完成。现在,您可以从计算机上的任何目录运行所有Java命令。再次,不要删除现有路径,您必须将此新路径添加到现有路径中,使用分号分隔。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.