“java.exe” is not recognized as an internal or external command, operable program or batch file

后端 未结 7 814
春和景丽
春和景丽 2021-01-16 04:52

I am writing an application that creates a Java portlet by the ant batch file with the cmd.exe using a Process object in C#.

When I pass the \"Create\" command to th

相关标签:
7条回答
  • 2021-01-16 05:05

    try setting tha java path properly

    can u give me the exact error message u get...

    0 讨论(0)
  • 2021-01-16 05:08

    I had the same problem and solved it. I'm using 64-bit Windows 7 with 64-bit Java. Setting the compile target in the Configuration Manager to 'x64' solved it. If you use 'any CPU' the build probably falls back to 'x86', which is not working with 64-bit Java. So you need different builds for different machines...

    0 讨论(0)
  • 2021-01-16 05:09

    If you have multiple values in your PATH variable, make sure they are not separated with a space following the end semi-colon (;)

    0 讨论(0)
  • 2021-01-16 05:10

    I also ran into the same problem and found my solution. It might help you too.

    1. Set the PATH variable. I don't know if this step is required or not, but i just added the path to java.exe in TEMP variable.
    2. At command prompt changed the current directory to java.exe parent directory.
    3. Now ran to command which i required. If some file is been referenced in the command then i put the complete path.

    Hope it helps you.

    0 讨论(0)
  • 2021-01-16 05:16

    I don't know if this will help anyone else that is viewing this post but when i had this problem it was because I was running a x64 machine and the java.exe was installed to the ProgramFiles(x86) folder. I simply added the path to the exe to the 'PATH' environment variable and then it fired up just fine.

    Hope this helps someone.

    0 讨论(0)
  • 2021-01-16 05:26

    You should check your PATH variable. You can use the set command to set the correct path to your java environment folder.

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