find java.exe,找不到java.exe

I am trying to launch a .bat file but I get the error

System cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe

I understand that this is probably a path variable, but I have not been able to understand how to fix it, if that is the problem.

Thanks in advance.

解决方案

First of all, the path that you provided i.e. C:\ProgramData\Oracle\Java\javapath\java.exe doesn't appear to be correct. It should point to either JRE or JDK folder that you (probably) have in here:

C:\Program Files (x86)\Java\jdk1.8.0_25\bin

In there you should at least see the following files (and hence, the addition of this bin directory to your PATH variable in the env vars):

java.exe

javac.exe

javaw.exe

javap.exe

java.h.exe

java-rmi.exe

javadoc.exe

jarsigner.exe

jar.exe

If you don't see the files above, something is definitely wrong! Also, even if you were using JRE (not JDK), you should still have this bin folder present, where java.exe resides.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用中提到,在运行时,系统自动寻到路径"C:\ProgramData\Oracle\Java\javapath"下的"java.exe"文件,但是发现该文件不存在,因此报错"系统不到文件 C:\ProgramData\Oracle\Java\javapath\java.exe"。而在引用和中提到的解决方法是将JDK和JRE的路径放在系统变量Path的第一个位置,即将其放在"C:\ProgramData\Oracle\Java\javapath"之前。这样系统在寻"java.exe"文件时会首先到JDK和JRE的路径,从而解决了报错的问题。因此,您可以尝试将JDK和JRE的路径移到"C:\ProgramData\Oracle\Java\javapath"之前,或者删除该路径,然后再次运行命令"java -version"。这样应该可以成功到"java.exe"文件,并显示出Java的版本信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [安装JDK1.8报错Error: could not find java.dll Error: Could not find Java SE Runtime Environment.](https://blog.csdn.net/dazuo_001/article/details/118090927)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [安装JDK,出现错误:Error: could not find java.dll](https://blog.csdn.net/weixin_42451493/article/details/81004238)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值