Launching CYGWIN-built executable from Java on Windows 7 fails with “error while loading shared libraries: ?: No such file or directory”

前端 未结 2 1847
灰色年华
灰色年华 2021-01-15 05:34

The code in question has worked in more or less the exact same configuration on earlier releases of Windows, however, it is not known to have run on Windows 7 YET! That\'s w

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-15 06:13

    C:/cygwin/bin/bash -c '/cygdrive/c/opt/ST/v3.3/bin/ST.exe'
    

    This won't work because your working directory is where you reside when you executed this command. You will have to copy the cygwin dependent dlls to the directory you execute this from. Othwerwise, you will have to place the cygwin bin directory in your system PATH variable, not sure you want to do that, can cause dll hell.

    Also, if you're using anything in your profile, you need to add --login parameter to bash:

    bash --login -c
    

    Also, print the final command out at the end, before you spawn the process:

    printf('%s\n',cmd)
    

    Just to be sure it's exactly what you want.

    You may also run the program with strace, if you're unsure about the dlls being referenced.

提交回复
热议问题