Issue with The System cannot find the file specified

后端 未结 1 900
再見小時候
再見小時候 2021-01-28 02:35

I\'m having an issue with \"The System cannot find the file specified\"

Here is the part of my code that fails:

var processInfo = new ProcessStartInfo(\"         


        
相关标签:
1条回答
  • 2021-01-28 02:51

    First make sure that Java has been installed on the server. Then you should check the following:

    If you start a process, it looks for the file name both in the working directory and in the directories listed in the PATH environment variable. Chances are good that on your developer machine the Java-directory has been added to the PATH variable for convinience.

    Instead of assigning just java as the executable path, a more stable way is to provide the full path of the executable you want to start.

    A - less clean - way to fix this quickly is to change the PATH variable on the server so that the Java-directory is also contained. Nevertheless I'd propose to reference the executable by its full path so that you don't have to change the PATH variable on each computer you want to run your program on.

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