Error: Cannot run program “jar”: CreateProcess error=2, The system cannot find the file specified

后端 未结 11 2223
梦如初夏
梦如初夏 2020-12-10 01:33

When I run my BlackBerry project in Eclipse, I get the following error:

Error: Cannot run program \"jar\": CreateProcess error=2, The system cannot fi

相关标签:
11条回答
  • 2020-12-10 02:03

    you can solve this problem by following setting

    Right Click My Computer -> Select Properties-> Select AdvancedSystem Settings Tab -> Environment variables Click on new button and Add

    Variable Name : JAVA_HOME Variable Value : C:\Program Files\Java\jdk1.7.0\

    note jdk not jre

    0 讨论(0)
  • 2020-12-10 02:06

    Finally I get the solution .copy the jar.exe from java bin folder and paste to the jre bin folder.

    0 讨论(0)
  • 2020-12-10 02:08
    1. Set the Environment variable correctly (under path set till jdk->bin)
    2. In your Eclipse Installed JREs make sure you are pointing till JDK folder and not JRE
    0 讨论(0)
  • 2020-12-10 02:10

    i think you need to set jarfile path.

    0 讨论(0)
  • 2020-12-10 02:14

    I tried several of the posted methods, the important step seemed to be setting the correct system path (the "Path" environmental variable) to have included a folder that pointed to the relevant jar.exe. The variable changed from X to X + ;C:\Program Files\Java\jdk1.7.0_03\bin; you need to make sure the jdk folder part is relevant to your version, which I overlooked.

    The reason for my answer is to add the step I missed; which is to restart Eclipse! I tried running it a few times, but after closing and reopening it the project packaged correctly. It might not have been obvious to do this.

    0 讨论(0)
  • 2020-12-10 02:14

    Adding C:\Program Files\Java\jdk1.8.0_131 to JAVA_HOME and C:\Program Files\Java\jdk1.8.0_131\bin to Path in System Variables within Environment Variables wasn't sufficient.

    Turns out, you need to add those two variables and their respective values to both user and system variables within environment variables.

    I added the following to BOTH User variables as well as System variables in Environment Variables: Variable: JAVA_HOME Value: C:\Program Files\Java\jdk1.8.0_131

    Variable: Path Value: C:\Program Files\Java\jdk1.8.0_131\bin

    That worked for me !

    0 讨论(0)
提交回复
热议问题