在Windows 10命令提示符中运行Java程序 [英] Running Java Programs in Windows 10 Command Prompt

查看:73
本文介绍了在Windows 10命令提示符中运行Java程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在运行Windows 10的计算机上下载了Java SDK 8.0.但是,当我在Internet上寻找如何在Windows 10命令提示符中使用Java时,我只能获得 javac 命令在提示符下工作.当我尝试运行程序时,命令提示符说它找不到 java.exe 文件.有谁知道如何使Java在Windows 10中运行?(我正在使用Java的x86版本.)

I recently downloaded Java SDK 8.0 on my computer running Windows 10. However, when I looked on the Internet for how to use Java in the Windows 10 Command Prompt, I was only able to get the javac command to work in the prompt. When I tried to run my program, the command prompt said that it could not find the java.exe file. Does anyone know how to make Java work in Windows 10? (I'm using the x86 version of Java.)

推荐答案

打开命令提示符 cmd 并键入 where java ,这将输出java可执行文件所在的位置,然后您可以转到系统属性>高级>环境变量> (右键单击计算机,然后单击属性)并将 where java 输出添加到以分号 ;

Open command prompt cmd and type where java , this will output where java executable is, then you can go to System Propreties>Advanced>Environement Variables> (Right click on computer and click on Propreties) and add the where java output to the PATH variable separated with a semi-colon ;

这篇关于在Windows 10命令提示符中运行Java程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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